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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -