Reputation: 77
int igotit = getResources().getIdentifier(val, "drawable", getPackageName());
i got resourceid from that how to display imagename?
Upvotes: 6
Views: 3218
Reputation: 24181
use this :
String imageName = getResources().getResourceName(R.id.img);
refer doc . there is also the method : getResourceEntryName(int)
Upvotes: 7