Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get image name from resourceid in android?

Tags:

android

int igotit = getResources().getIdentifier(val, "drawable", getPackageName());

i got resourceid from that how to display imagename?

like image 735
ssk Avatar asked Nov 28 '12 11:11

ssk


1 Answers

use this :

String imageName = getResources().getResourceName(R.id.img);

refer doc . there is also the method : getResourceEntryName(int)

like image 87
Houcine Avatar answered Sep 21 '22 01:09

Houcine