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

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -