Possible Duplicate:
How can I pass a Bitmap object from 1 activity to another
i am using a camera application in android. in my application im tried to pass the image that clicked to another activity. code as shown bellow,
PictureCallback jpegCallback = new PictureCallback()
{
public void onPictureTaken(byte[] data, Camera camera)
{
Intent i = new Intent(Hackbook.this, view.class);
i.putExtra("photo", data);
Log.d(TAG, "jpegCallback1" +data);
startActivity(i);
}
};
and second activity view.java is,
setContentView(R.layout.view);
Bundle extras = getIntent().getExtras();
byte[] photo = extras.getByteArray("photo");
Log.i(TAG, "jpegCallback2" + photo);
Bitmap bitmap = BitmapFactory.decodeByteArray (photo, 0, photo.length);
ImageView imgView = (ImageView)findViewById(R.id.photoResultView);
imgView.setImageBitmap(bitmap);
when i run this in emulator i got an image that inbuilt in the emulator. But when im tried to run this in my device there is no image displayed in the second activity. Logcat is shown bellow,
12-14 17:58:33.756: DEBUG/camera(630): jpegCallback1[B@44f90d60
12-14 17:58:33.785: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.facebook.android/.view (has extras) }
12-14 17:58:33.985: INFO/Camera(630): jpegCallback2[B@44f385e0
12-14 17:58:34.605: INFO/ActivityManager(58): Displayed activity com.facebook.android/.view: 730 ms (total 730 ms)
12-14 18:00:56.351: DEBUG/SntpClient(58): request time failed: java.net.SocketException: Address family not supported by protocol
If anyone know about this please help me....