android - Dynamic image with variable as a name -
i trying display image when have variable array (arr[r1]) matches name of picture. tried using didnt work:
imageview imageview = (imageview)findviewbyid(r.id.imageview); imageview.setimagedrawable(getresources().getdrawable(getresources().getidentifier("drawable/"+arr[r1], "drawable", getpackagename())));
any thought doing wrong?
string filepath = getactivity().getfilestreampath("myimage.png").getabsolutepath(); img.setimagedrawable(drawable.createfrompath(filepath));
android imageview
No comments:
Post a Comment