title: How to draw circle by canvas in Android?
body: <p>I want to draw circle by canvas. Here is my code:</p>
  <p>[MyActivity.java]:</p>
  <pre><code>public class MyActivity extends Activity 
  {
   public void onCreate(Bundle savedInstanceState) 
     {
        ...
        setContentView(new View(this,w,h));
     }
          
  }
  </code></pre>
  <p>[View.java]:</p>
  <pre><code>public class View extends SurfaceView
  {
      public View(Context context, int w, int h)
      {
          super(context);
          Canvas grid = new Canvas(Bitmap.createBitmap(h,w, Bitmap.Config.ARGB_8888));
          grid. drawColor(Color.WHITE);
          Paint paint = new Paint();
          paint.setStyle(Paint.Style.FILL);
          grid.drawCircle(w/2, h/2 , w/2, paint);
      }
  }
  </code></pre>
  <p>So I have just black screen without circle.
  Why it does not work? How to fix it?</p>