I just answered another question on Stack Overflow on how to get the associated image/Drawable id in an ImageView for Android.

The following is what I wrote, for your convenience:

Unfortunately, there is no `getImageResource()` or `getDrawableId()`. But, I created a simple workaround by using the ImageView tags.

In onCreate():

imageView0 = (ImageView) findViewById(R.id.imageView0);
    imageView1 = (ImageView) findViewById(R.id.imageView1);
    imageView2 = (ImageView) findViewById(R.id.imageView2);


Then, if you like, you can create a simple function to get the drawable id:

private int getImageResource(ImageView iv) {
        return (Integer) iv.getTag();

I hope this helps you, it sure made my work easier.