title: Why is drawing to the Android canvas not modifying my bitmap?
body: <p>Looking for help troubleshooting why the bitmap is not being modified by this drawing.  Have looked at numerous examples, and my code seems to match what is listed. What am I missing?</p>
  
  <p>This is the relevant code (the class is constructed elsewhere, and the <code>drawSomething()</code> call is in an <code>onTouchEvent</code> handler). I've shortened the code for brevity:</p>
  
  <pre><code>class MyView extends View {
  
      Bitmap mBitmap;
      BitmapDrawable mBitmapDrawable;
      Canvas mCanvas;
      Paint mPaint;
  
      public MyView(Context context) {
          super(context);
          mBitmap = Bitmap.createBitmap(500, 500, Bitmap.Config.ARGB_8888);
          mBitmapDrawable = new BitmapDrawable(getResources(), mBitmap);
          mCanvas = new Canvas(mBitmap);
          mCanvas.setBitmap(mBitmap);
          mPaint = new Paint();
          mPaint.setColor(Color.parseColor("#00FF00"));
          mPaint.setStrokeWidth(10);
      }
  
      public void drawSomething() {
          mCanvas.drawColor(0xFF00FF00);  // This should "fill" the canvas
          int radius = 10;
          mCanvas.drawCircle(50, 50, radius, mPaint);     // This should draw a circle at (50, 50)
  
          int count=0;
          for (int i=0; i&lt;mBitmap.getWidth(); i++)
          {
              for (int j=0; j&lt;mBitmap.getHeight(); j++)
              {
                  if (mBitmap.getPixel(i, j) &gt; 0)
                  {
                      count += 1;
                  }
              }
          }
          if (count == 0)
          {
              Log.v("MyApp", "Nothing was drawn!");
          }
      }
  }
  </code></pre>