I have: public class TestButton extends ImageButton {....
I have some code which generates a null pointer exception at:
  final Drawable temp1 = babyview.getDrawable();
Before this I use:
 public void dancebabydance() {
  babyview = (ImageView) findViewById(R.id.baby);
Here is the xml portion:
<ImageView
    android:id="@+id/baby"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:src="@drawable/dbaby2"
     />
I am ideally trying to compare this dbaby2 to a drawable and see if they are equal, and if they are change them to something new.
Can this be done extending ImageButton like this? Where am I stuffing up?