As the title pretty much states.
here is what i am trying to do
1) Open Gallery (I know how to do this) 2) Choose image from gallery 3) Get the Image Id and pass the ID to another Activity 4) In this other activity i want to load this image into an ImageView.
I know i can do this instead
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
then pass array to intent
Intent intent = new Intent(this, NextActivity.class);
intent.putExtra("picture", byteArray);
startActivity(intent);
and then get Byte Array from Bundle and Convert into Bitmap Image
Bundle extras = getIntent().getExtras();
byte[] byteArray = extras.getByteArray("picture");
Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
ImageView image = (ImageView) findViewById(R.id.imageView1);
image.setImageBitmap(bmp);
But i believe that it will be better on memory and performance by passing ID instead and then getting id in the next activity and loading image from the SD card.