subclassing a View and overriding onDraw(Canvas)
<p>When I'm instantiating myView in the Activity, why is it necessary to pass the context and why is it required to pass the context to the View's constructor? What is the significance?</p>

<pre><code>import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.graphics.Canvas;

public class POCII extends Activity {

   myView mv = new myView(this);
   /** Called when the activity is first created. */

   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(mv);
   }
}

class myView extends View {

   public myView(Context context) {
      super(context);
   }

   @Override
   public void onDraw(Canvas canvas) {
      Paint paint = new Paint();
      canvas.drawRect(0,0,100,100, paint);
   }
}
</code></pre>
