getImageResource() Android. Is this possible?

Viewed 12055

I have set an image for an ImageView using the setImageResource(R.drawable.icon1).

Now my requirement is to find out what is the image that is set for an ImageView and do some processing.

Like

if (imageView.getImageResource() == R.drawable.icon1) {
  //do some processing
else if (imageView.getImageResource() == R.drawable.icon2) {
  //do somethign else
else 
 //display

So I would like to know if there exists a method(AFAIK, it doesn't) and if it doesn't how to keep a track of what resources have been set for an ImageView.

Thanks. Sana.

5 Answers
Related