title: ImageView: onDraw method draws "behind" the image background, not at the top
body: <p>Here is the code of a simple extension of an ImageView that allow the user to draw with the finger.</p>
  
  <pre><code>public class MyImageView extends ImageView {
  
      List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();
      Paint paint = new Paint();
  
      public MyImageView(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      @Override
      public void onDraw(Canvas canvas) {
          for (Point point : points) {
              canvas.drawCircle(point.x, point.y, 5, paint);
              // Log.d(TAG, "Painting: "+point);
          }
          super.onDraw(canvas);
      }
  
      @Override
      public boolean onTouchEvent(MotionEvent event) {
          super.onTouchEvent(event);
          Point point = new Point();
          point.x = event.getX();
          point.y = event.getY();
          points.add(point);
          invalidate();
          Log.d("", "point: " + point);
          return true;
      }
  
      class Point {
          float x, y;
          @Override
          public String toString() {
              return x + ", " + y;
          }
      }
  }
  </code></pre>
  
  <p>This work pretty well.</p>
  
  <p>Now, I want to use this code to draw at the top of a Bitmap.</p>
  
  <p>I used: </p>
  
  <pre><code>MyImageView ivPic = (MyImageView) dialog.findViewById(R.id.ivPic);
  ivPic.setImageBitmap(picture);
  </code></pre>
  
  <p>But the drawing is drawn "behind" the Bitmap:</p>
  
  <p><img src="https://i.stack.imgur.com/EYUhQ.png" alt="enter image description here"></p>
  
  <p>Do you have any idea how I can draw at the "top" of the Bitmap?</p>