title: Why is the rectangle not shown when I used drawRect()?
body: <p>Why is the rectangle not shown when I used drawRect() on canvas object,
  and also declared it inside onCreate method. </p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activitymain);
      Chronometer stopWatch = (Chronometer)findViewById(R.id.chrono);
      mDrawingActivity = (DrawingActivity)findViewById(R.id.the_canvas);
      Button b = (Button)findViewById(R.id.startButton);
      b.setText("start");
      b.setOnClickListener(this);
  }
  </code></pre>
  
  <p><strong>OnDraw() Method</strong></p>
  
  <pre><code>protected void onDraw(Canvas Square) 
      {
          super.onDraw(Square);
              Paint squareColor = new Paint();
              squareColor.setColor(Color.CYAN); // change the box color to cyan
          Square.drawRect(100,100,100,100, squareColor); 
  return;
      }
  </code></pre>
  
  <p>Clarification: Even the button and chronometer are not shown too and the program is forced closed.</p>