Im using a camera application in android. I want to pass the byte data from PictureCallback method to another activity and want to display it in that activity.
Camera.PictureCallback jpegCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
}
};
If anyone Knows about it, please help me..
You can do that with extras:
and the on the B Activity:
To show the image on the second activity, you must convert the byte[] into a bitmap and the assign it to a imageView:
I never tried to decode from byte[] to bitmap.. but you can find more information here.
EDIT: @ss1271’s comment is right. According to this answer seems that there’s a limit of 500Kb. which means that if your image is big you should save it and pass the reference to the new activity like this: