I want to get the image name in android
eg,
ImageView img = (ImageView)findViewByID(R.id.MyImage); img.srcName() // it should return following android:src="@drawable/abc"
Is this possible or not? Any help would be appreciated.
is it possible or not?
It's impossible. First, there cannot be a resource involved in ImageView , since images can come from many places.
ImageView
You can get the name of the resource using this function:
getResources().getResourceName(resid);
But for this you need a ResID. Check out Resources.