java - android set ImageView src by parameter -


i need set image resource send parameter (string src)

i have code

public void getsource(view view , string src){      imageview image = (imageview)findviewbyid(r.id.img);     image.setimageuri(src); } 

how solve problem ؟


// method call set image     private void setimage(int src) {        imageview iv = findviewbyid(r.id.your_image_view);        iv.setimageresource(src);    } 

//pass resource , use :-

setimage(r.drawable.plus_active); 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -