Im trying to capture the image and send it to the next activity but whenever im clicking on the capture button my app crashes. here is the code below:
btn_capture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//----function call
captureImage();
}
});
jpegCallback = new Camera.PictureCallback(){
@Override
public void onPictureTaken(byte[] bytes, Camera camera) {
Intent i = new Intent(getActivity(),ShowCaptureImage.class);
i.putExtra("capture", bytes);
startActivity(i); //<--------- error is occuring here
return;
}
};
return vw;
}
//------------PICTURE TAKEN FUNCTION--------------
private void captureImage() {
camera.takePicture(null,null, jpegCallback);
}