How to clear finger paint?
<p>I am new to android,i prepared one painting view using finger with help of FingerPaint.java in Api Demo.It is working fine.</p>

<p>The same view contains one button(clear),if we click on button paint will be clear(empty sceen and one button).My problem is how to clear the paint.My view code is,</p>

<pre><code>public class MyDraw extends View {

    Paint mPaintAlphabet = new Paint();

    private static final float MINP = 0.25f;
    private static final float MAXP = 0.75f;

    float x, y;
    float mX, mY;
    private static final float TOUCH_TOLERANCE = 4;

    private Bitmap mBitmap;
    Canvas mCanvas;
    Path mPath;
    Paint mBitmapPaint;

    public MyDraw(Context context) {
        super(context);

        mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
        mCanvas = new Canvas(mBitmap);
        mPath = new Path();
        mBitmapPaint = new Paint(Paint.DITHER_FLAG);


    }

    public MyDraw(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);

        mBitmap = Bitmap.createBitmap(480, 480, Bitmap.Config.ARGB_8888);
        mCanvas = new Canvas(mBitmap);
        mPath = new Path();
        mBitmapPaint = new Paint(Paint.DITHER_FLAG);

        mPaintAlphabet.setDither(true);
        mPaintAlphabet.setColor(0xFFFF0000);
        mPaintAlphabet.setStyle(Paint.Style.STROKE);
        mPaintAlphabet.setStrokeJoin(Paint.Join.ROUND);
        mPaintAlphabet.setStrokeCap(Paint.Cap.ROUND);
        mPaintAlphabet.setStrokeWidth(3);
        mPaintAlphabet.setTextSize(350);

    }

    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
    }

    public void onDraw(Canvas canvas) {

            if (MyAlphabetsActivity.mArryLstAlphabets.get(
                MyAlphabetsActivity.mAlphaIndex).equals("I")) {

            canvas.drawText((String) MyAlphabetsActivity.mArryLstAlphabets
                    .get(MyAlphabetsActivity.mAlphaIndex), 180, 300,
                    mPaintAlphabet);

        } else if (MyAlphabetsActivity.mArryLstAlphabets.get(
                MyAlphabetsActivity.mAlphaIndex).equals("J")) {

            canvas.drawText((String) MyAlphabetsActivity.mArryLstAlphabets
                    .get(MyAlphabetsActivity.mAlphaIndex), 180, 300,
                    mPaintAlphabet);

        } else {
            canvas.drawText((String) MyAlphabetsActivity.mArryLstAlphabets
                    .get(MyAlphabetsActivity.mAlphaIndex), 120, 300,
                    mPaintAlphabet);
        }

        System.out.println("in on draw");
        System.out.println("path is----" + mPath);

        canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);

        canvas.drawPath(mPath, MyAlphabetsActivity.mPaint);
    }

    private void touch_start(float x, float y) {
        mPath.reset();
        System.out.println("mPath-----"+mPath);
        mPath.moveTo(x, y);
        mX = x;
        mY = y;
    }

    private void touch_move(float x, float y) {
        float dx = Math.abs(x - mX);
        float dy = Math.abs(y - mY);
        if (dx &gt;= TOUCH_TOLERANCE || dy &gt;= TOUCH_TOLERANCE) {
            mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
            mX = x;
            mY = y;
        }
    }

    private void touch_up() {
        mPath.lineTo(mX, mY);
        // commit the path to our offscreen
        mCanvas.drawPath(mPath, MyAlphabetsActivity.mPaint);
        // kill this so we don't double draw
        mPath.reset();
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        x = event.getX();
        y = event.getY();

        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            touch_start(x, y);
            invalidate();
            break;
        case MotionEvent.ACTION_MOVE:
            touch_move(x, y);
            invalidate();
            break;
        case MotionEvent.ACTION_UP:
            touch_up();
            invalidate();
            break;
        }
        return true;
    }


}
</code></pre>

<p>And my Activity code is,</p>

<pre><code>public class MyAnimViewActivity extends Activity
         {    
    public static Paint       mPaint;
    private MaskFilter  mEmboss;
    private MaskFilter  mBlur;
    Button mBtnClear;
    MyDraw mMyDraw=new MyDraw();
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new MyOwnView(this));

        mPaint = new Paint();
        mPaint.setAntiAlias(true);
        mPaint.setDither(true);
        mPaint.setColor(0xFFFF0000);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeJoin(Paint.Join.ROUND);
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeWidth(12);

        mEmboss = new EmbossMaskFilter(new float[] { 1, 1, 1 },
                                       0.4f, 6, 3.5f);

        mBlur = new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL);

        mBtnClear=(Button)findViewById(R.id.btnClear);

        mBtnClear.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                switch (v.getId()) {
                case R.id.btnClear:
                    mMyDraw.mPath.reset();

                    break;

                }
            }
        });
    }
}
</code></pre>

<p>Please help me..Thanks in advance </p>
