title: Android draw on canvas
body: <p>New to Android development, and I'm having trouble doing a simple drawing to a view using a canvas.</p>
  
  <p>From what I've understood, something like this:</p>
  
  <pre><code>import android.content.Context;
  import android.graphics.Canvas;
  import android.view.View;
  
  public class DrawView extends View
  {
      public DrawView(Context context)
      {
          super(context);
      }
  
      @Override
      protected void onDraw(Canvas canvas)
      {
          super.onDraw(canvas);
          canvas.drawRGB(255,0,0);
      }
  }
  </code></pre>
  
  <p>With this as my Activity:</p>
  
  <pre><code>public class Prototype1 extends Activity
  {
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
      }
  }
  </code></pre>
  
  <p>And this for the layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
      &lt;com.dhs2.prototype1.DrawView
          android:id="@+id/map"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Should just draw red everywhere, but instead I just get a blank screen.
  Any idea where I'm going wrong?</p>