I want to transfer the image from one activity to another

In your first Activity

Convert ImageView to Bitmap

    imageView.buildDrawingCache();
    Bitmap bitmap = imageView.getDrawingCache();

    Intent intent = new Intent(this, NewActivity.class);
    intent.putExtra("BitmapImage", bitmap);

In second Activity

     Bitmap bitmap = (Bitmap) intent.getParcelableExtra("BitmapImage");

Then display bitmap in ImageView.

Note: this is not recommended. Should actually save the image somewhere and pass the path instead and retrieve from second activity.

Leave a Comment