title: Android: Canvas.drawText when button click
body: <p>How to <code>drawText</code> when button click? How can I <code>setContentView(R.layout.main)</code> to see the button and draw the text when button click? I cannot make it, and below is my code for drawing text.<pre><code>public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       drawView = new DrawView(this); 
       setContentView(drawView); 
  }
  public DrawView(Context context) { 
       super(context); 
       textpaint.setColor(Color.WHITE);
  }
  public void onDraw(Canvas canvas) {
       canvas.drawText("Testing", 20, 55, textpaint);
  }</code></pre></p>