title: Why canvas.setBitmap() hides other views in Parent?
body: <p>I have this class that extends <code>View</code>:</p>
  
  <pre><code>public class DrawingPanel extends View {
  
      private Bitmap toDisk;
      private int w;
      private int h;
  
      public DrawingPanel(Context context, AttributeSet attrs) {
          super(context, attrs);
          System.out.println("Drawing");
          p0 = new Paint();
          p0.setStyle(Style.STROKE);
  
      }
  
      @Override
      public boolean onTouchEvent(MotionEvent event) {
  
          ...
      }
  
      @Override
      protected void onSizeChanged(int w, int h, int oldw, int oldh) {
          this.w = w;
          this.h = h;
          toDisk = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
          super.onSizeChanged(w, h, oldw, oldh);
      }
  
      @Override
      public void onDraw(Canvas canvas) {
  
          canvas.drawColor(Color.WHITE);
          canvas.drawPath(path0, p0);
          canvas.setBitmap(toDisk);
  
      }
  
  }
  </code></pre>
  
  <p>I use this class as a child view in a layout. In the <code>Graphical view</code> of Eclipse all things are OK, and all views are visible, but in emulator my class (<code>DrawingPanel</code>) hides other views that are below it. When I remove this line:</p>
  
  <pre><code>canvas.setBitmap(toDisk);
  </code></pre>
  
  <p>all views will be visible again. And another strange thing: when I put that line in the first line of <code>onDraw</code> method like this:</p>
  
  <pre><code>@Override
      public void onDraw(Canvas canvas) {
                  canvas.setBitmap(toDisk);
          canvas.drawColor(Color.WHITE);
          canvas.drawPath(path0, p0);
      }
  </code></pre>
  
  <p>my <code>DrawingPanel</code> and other views that are below it will be invisible. How can I solve this problem?
  <strong>My purpose is to save what user draws on canvas.</strong></p>