Q:

how to apply undo operation on bitmap image inside imageview.i wanto to undo the effects

I am applying different effects on bitmap image inside image view.this image comes from mainactivity.
Here is the code:
    Bundle extras=getIntent().getExtras();
        //b=(Bitmap)extras.get("img");

        byte[] byteArray=extras.getByteArray("img");

        bmp=BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
        camphoto=(ImageView)findViewById(R.id.camimage);
        camphoto.setImageBitmap(bmp);

And effects like this: 
case R.id.btnsepia:
        BitmapDrawable  abmp = (BitmapDrawable)camphoto.getDrawable();
        bmp = abmp.getBitmap();
        Bitmap bmOut=Bitmap.createBitmap(createSepiaToningEffect(bmp, 3, .89, .66, .5));
           camphoto.setImageBitmap(bmOut);
        break;

Now I want to undo the effect so that I get the origional image back in image view.

A:

This is not possible.
A bitmap object does not automatically log all changes that are applied to it, so that you can just call something like bitmap.undo();. And even if that was possible, it would not work as you are generating a completely new bitmap from the source image with the effect. The original image is not contained in the new one anymore.
You will have to keep track of the changes yourself. Maybe just passing over the original and modified image in the Intent would serve your needs.

