how to paint on an image and save the image to phone gallery in android
<p>** my intent is to save the painted image along with my background view to gallery**                    //</p>

<pre><code>public boolean onTouch(View view, MotionEvent event) {

        // draw the new Points to our internal canvas / bitmap

        System.out.println("onTouch(View vc) { IS CALLING11111111111");

        if (event.getAction() == MotionEvent.ACTION_DOWN) {

            paint.setColor(Color.RED);

            path = new Path();

            path.moveTo(event.getX(), event.getY());

        } else 
                      if (event.getAction() == MotionEvent.ACTION_MOVE) {

            int historySize = event.getHistorySize();

            for (int i = 0; i &lt; historySize; i++) {

                path.lineTo(event.getHistoricalX(i),            
                                               event.getHistoricalY(i));

            }

            path.lineTo(event.getX(), event.getY());

            canvas.drawPath(path, paint);

        } 
                 else {
            return super.onTouchEvent(event);
        }

        invalidate();

        return true;
    }
</code></pre>
