MediaStore.ACTION_IMAGE_CAPTURE problem
I am using the following code to start the default Camera.Image is getting saved successfully.After coming to OnResultActivity() method its calling onCreate() method of parent activity and initializing all instance variables once again.I want it should return to same parent activity.
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXT开发者_运维问答RA_OUTPUT, Uri.fromFile((new File("/sdcard/","test.jpg"))));
startActivityForResult(cameraIntent, 0);
Android has the option of killing and restarting your activity whenever it wants. You should get an onPause(), at least, where you can persist whatever state you need to keep. See Activity Lifecycle stuff here.
精彩评论