When I take a picture with the camera in my app the app/activity restarts (and all other activities are closed too) when I save the picture I took. Also when I debug the app, the debugger disconnects after taking the picture.
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
File file = getOutputMediaFile(1);
picUri = Uri.fromFile(file);
i.putExtra(MediaStore.EXTRA_OUTPUT, picUri);
startActivityForResult(i, 0);
My onActivityResult:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case 0:
mProgress.show();
loadCameraImage();
break;
case 1:
mProgress.show();
Uri uri = imageReturnedIntent.getData();
loadFileImage(uri);
break;
}
}
}