Search code examples
androidimageview

How to get Image name in java?


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.


Solution

  • 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.