title: Android: FrameLayout subclass does not draw
body: <p>This is, what works:</p>
  
  <p>a) FrameLayout with two ImageViews in main.xml</p>
  
  <p>
  
      </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" android:id="@+id/frameLayout1"
      android:layout_height="wrap_content"&gt;
  
      &lt;ImageView android:src="@drawable/radar_background"
          android:id="@+id/background" android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;&lt;/ImageView&gt;
  
      &lt;ImageView android:src="@drawable/radar_sector" android:id="@+id/sector"
          android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageView&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>b) RotateAnimation on the background, whereas the foreground sector remains unchanged</p>
  
  <p>Because I need to do a bit more on the background image I put this into a FrameLayout subclass and changed main.xml accordingly:</p>
  
  <p>
  
      </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" android:id="@+id/frameLayout1"
      android:layout_height="wrap_content"&gt;
  
      &lt;com.decades.SensorTest.RadarView
          android:id="@+id/background" android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt; 
      &lt;ImageView android:src="@drawable/radar_sector" android:id="@+id/sector"
          android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageView&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is the new RadarView.java:</p>
  
  <pre><code>public class RadarView extends FrameLayout {
  
      private Bitmap mRadar;
  
      public RadarView(Context context, AttributeSet attrs) {
          super(context, attrs);
          init();
      }
  
      public RadarView(Context context) {
          super(context);
          init();
      }
      private void init() {
          mRadar = BitmapFactory.decodeResource(getResources(), R.drawable.radar_background);
      }
  
      @Override
      public void dispatchDraw(Canvas canvas) {
          super.dispatchDraw(canvas);
          canvas.drawBitmap(mRadar, 0, 0, null);
      }
  }
  </code></pre>
  
  <p>What happens:</p>
  
  <p>a) The constructor is called during  setContentView(R.layout.main);</p>
  
  <p>b) The dispatchDraw override is called </p>
  
  <p>c) The image does <em>not</em> appear on the screen...</p>
  
  <p>Does anybody see, why?</p>