Please take a look at the FingerPaint example in ApiDemos.

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.

On Aug 1, 10:43 am, patrick91 <[email protected]> wrote:
> Hi, I've this code:
>
> Java: (http://nopaste.me/4449)
>
> package com.patrick.games.whackgroundhog;
>
> import android.app.Activity;
> import android.content.Context;
> import android.graphics.Canvas;
> import android.graphics.Color;
> import android.graphics.Paint;
> import android.os.Bundle;
> import android.view.MotionEvent;
> import android.view.View;
>
> public class Game extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(new Ground(this));
>     }
>
>     class Ground extends View {
>
>           public Ground(Context context) {
>                super(context);
>           }
>
>           public void onDraw(Canvas canvas) {
>                canvas.drawColor(Color.BLACK);
>
>           }
>
>           @Override
>           public boolean onTouchEvent(MotionEvent event) {
>
>                if (event.getAction() == MotionEvent.ACTION_DOWN) {
>                     //TODO: draw the circle
>                }
>                return true;
>           }
>
>     }
>
> }
>
> And I want to draw a circle when the onTouchEvent is called but I
> don't know how to get the canvas Sad
>
> Can you help me?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to