java - How to get resource id from String -
i have database column list of image names. want put in imageview using setimageresource. in other application managed this, in application imageview not showing @ all.
string image1 = db.getimage1now(randomindex); imageviewdothis1.setimageresource(getresources().getidentifier( image1, "drawable", getpackagename())); if this:
imageviewdothis1.setimageresource(r.drawable.image1); then it's working.. help!
use this:
imageviewdothis1.setimageresource(getresources().getidentifier( "image1", "drawable", getpackagename())); i think getidentifier supposed take string first parameter.
Comments
Post a Comment