views:

308

answers:

1

Hi,

In my activity , I create a Bitmap object, and I need to launch another activity, How can I pass this Bitmap object from the sub-activity (the one which is going to be launched)?

Thank you.

+2  A: 

Bitmap implements Parcelable, so you could always pass it in the intent:

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

and retrieve it on the other end:

Bitmap bitmap = (Bitmap) intent.getParcelableExtra("BitmapImage");
Erich Douglass
Thank you for your answer.
michael