This is my problem...:
In my activity I have an ImageView and a Button. I want the Button to perform an action ONLY when the ImageVie
As explained by Itsik, even if both variables contain references to objects that 'look' the same, they are 2 different objects instances.
The == operator compares references. It returns true only if both variables refer to the same object instance ie. the same memory space.
Neither Drawable nor BitmapDrawable implement a specific .equals() method that could have been adapted to check that 2 instances contain the same data, so Mathias Lin hint to try .equals() will not work.
What you could do, following Itsik's advice without having to extend Drawable, is use the View.setTag() and View.getTag() methods. These methods allow to attach any Object of your choice to a View and retrieve it later. By attaching a simple identifier (be it a technical integer identifier or a url defining the source of the bitmap) to your ImageView each time you change its content, you will be able to recognize it easily.