I am using an intent to call camera and onresult to get the captured image, but if the image is not taken (on pressing cancel), i want to get back to the screen where i called the camera from
i am using this right now….but is there a better way to do this:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!(data == null || resultCode == 0)) {
if (requestCode == CAMERA_REQUEST) {
photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
}
} else {
Intent intent = new Intent(ImageUploaderActivity.this,
ImageUploaderActivity.class);
startActivity(intent);
finish();
}
}
I am doing something similar in my app and here is my code: