[android] how to put image in a bundle and pass it to another activity

is there a way to put an image in a bundle and pass it to another activity? i've done my research and came up with putParcelable but i don't know how to get the passed image from the other activity and how to set the image to an imageView. i'm stuck please help.

   else if(img4.getId() == v.getId()){        Intent guess = new Intent(this, guess.class);        Bundle bundle = new Bundle();               Bitmap image4 = BitmapFactory.decodeResource(getResources(), R.drawable.renz);        bundle.putParcelable("image", image4);        guess.putExtras(bundle);        startActivity(guess);    } 

This question is related to android

The answer is


So you can do it like this, but the limitation with the Parcelables is that the payload between activities has to be less than 1MB total. It's usually better to save the Bitmap to a file and pass the URI to the image to the next activity.

 protected void onCreate(Bundle savedInstanceState) {     setContentView(R.layout.my_layout);     Bitmap bitmap = getIntent().getParcelableExtra("image");     ImageView imageView = (ImageView) findViewById(R.id.imageview);     imageView.setImageBitmap(bitmap);  }