Reputation: 77984
i want to get image name in android
for example,
ImageView img = (ImageView)findViewByID(R.id.MyImage);
img.srcName() // it should return following android:src="@drawable/abc"
is it possible or not? any help would be appreciated.
Upvotes: 4
Views: 2964
Reputation: 8
Try getResourcesEntryName()
method
getResources().getResourceEntryName(0x000000);
Upvotes: 0
Reputation: 1006624
is it possible or not?
It is not possible. For starters, there may not be a resource involved in the ImageView
, as images can come from many places.
Upvotes: 1
Reputation: 9058
You can get the name of the resource with this function:
getResources().getResourceName(resid);
But you need the resId for that. Check the Resources.
Upvotes: 3