title: android graphics and views
body: <p>I am having doubt related to working of canvas while drawing , it is mentioned that canvas holds the drawing calls and bitmap holds the actual pixel data ,for e.g in the code</p>
  
  <pre><code>public class MyView extends View{
  
      private Paint _p;
      public float x=10,y=10;
      private Canvas _canvas;
       static int cnt=0;
  
      public MyView(Context context) {
          super(context);
          // TODO Auto-generated constructor stub
          _p = new Paint();
          _p.setColor(Color.GREEN);
          _canvas = new Canvas();
  
          this.setOnTouchListener(new OnTouchListener() {
  
              @Override
              public boolean onTouch(View v, MotionEvent event) {
                  // TODO Auto-generated method stub
                  cnt++;
                  _canvas.drawCircle(event.getX(), event.getY(), 10, _p);
                  if(cnt&gt;3){
                      cnt = 0;
                      invalidate();
                  }
                  return false;
              }
          });
  
      }
  
      public void onDraw(Canvas can){
          _canvas = can;
          super.onDraw(_canvas);
          _canvas.drawColor(Color.BLACK);
          _canvas.drawCircle(x, y, 10, _p);
          x = x +10;
          y= y+10;
      }
  }
  </code></pre>
  
  <p>3 circles should be drawn but it is not the case , can anybody please explain me?thanks in advance</p>
  
  <p>Regards,
  Rohit</p>