开发者

MediaStore.ACTION_IMAGE_CAPTURE problem

开发者 https://www.devze.com 2023-02-21 01:22 出处:网络
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 initializin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消