save draw finger in android
===

i want to save a bitmap with drawfinger, i have all the code, but when save the image, only save the background, but not the lines that user has painted, but i can see the black lines.

This is my view class:

    public class VistaFirma extends View {
    
        private Bitmap mBitmap;
        private Canvas mCanvas;
        private Path mPath;
        private Paint mBitmapPaint;
        private Paint mPaint;
        private List<Path> mPathsArray = new ArrayList<Path>();
        private float mX, mY;
        private static final float TOLERANCIA_TOQUE = 4;
    
        // Constructor
       
        
    public Bitmap recuperaBitmap(){
        
        return mBitmap;
    }
    public VistaFirma(Context c, AttributeSet attrs)
    {
        super(c, attrs);
        mPaint = new Paint();
        mPaint.setColor(Color.BLACK);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeJoin(Paint.Join.ROUND);
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeWidth(5);
        mPath = new Path();
        mBitmapPaint = new Paint(Paint.DITHER_FLAG);
    }

    // Al crear la pantalla
    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
        mCanvas = new Canvas(mBitmap);
        mCanvas.drawColor(Color.WHITE);

    }

    // Guardar la firma
    public void guardaFirma(Context contexto,String cual) {
        try {
            String path = Environment.getExternalStorageDirectory().toString();
            OutputStream fOut = null;
            File file = new File(path, cual+".jpg");
            fOut = new FileOutputStream(file);
            mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
            fOut.flush();
            fOut.close();
            MediaStore.Images.Media.insertImage(contexto.getContentResolver(),file.getAbsolutePath(),file.getName(),file.getName());

        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

    // Limpiar el espacio de la firma
    public void limpiar() {
        mBitmap = Bitmap.createBitmap(250, 250, Bitmap.Config.RGB_565);
        mPath = new Path();
        invalidate();
    }

    // Metodo que se ejecuta al dibujar.
    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
        canvas.drawColor(Color.WHITE);
        canvas.drawPath(mPath, mPaint);

    }

    // Metodos de eventos; Pulsar,levantar y mover

    private void pulsar(float x, float y) {
        mPath.moveTo(x, y);
        mX = x;
        mY = y;
    }

    private void mover(float x, float y) {
        float dx = Math.abs(x - mX);
        float dy = Math.abs(y - mY);
        if (dx >= TOLERANCIA_TOQUE || dy >= TOLERANCIA_TOQUE) {
            mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
            mX = x;
            mY = y;
        }
    }

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

    // Metodo para seleccionar la accion
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        float x = event.getX();
        float y = event.getY();

        switch (event.getAction())
        {
        case MotionEvent.ACTION_DOWN:
            pulsar(x, y);
            invalidate();
            break;
        case MotionEvent.ACTION_MOVE:
            mover(x, y);
            invalidate();
            break;
        case MotionEvent.ACTION_UP:
            levantar();
            invalidate();
            break;
        }
        return true;
    }


and save this:                 vistaFirmaProfesional.guardaFirma(contexto,"profesional");


