Change ImageButton Drawable automatically

try this:

   int resID = getResources().getIdentifier(pDrawableName , "drawable", getPackageName());    
    imageview.setBackgroundResource(resID);

where String pDrawableName = file_xyz is your image name

Browse More Popular Posts

Leave a Comment