I try open camera following way:
...
private void runCamera() {
String storageState = Environment.getExternalStorageState();
if (storageState.equals(Environment.MEDIA_MOUNTED)) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imageFile = new File(Singleton.instanse.mPushFilePath);
mImageFileUri = Uri.fromFile(imageFile);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
mImageFileUri);
startActivityForResult(intent, CAMERA_RESULT);
}
...
if I run this method run next methods:
07-16 19:46:22.264: I/System.out(6875): -onPause
07-16 19:46:26.104: I/System.out(6875): -onStop
I make photo, end run next methods:
07-16 19:46:41.217: I/System.out(6875): -onDestroy
07-16 19:46:41.284: I/System.out(6875): -onCreate
07-16 19:46:41.291: I/System.out(6875): -onStart
07-16 19:46:41.295: I/System.out(6875): -onActivityResult
07-16 19:46:41.295: I/System.out(6875): -onResume
07-16 19:46:41.295: I/System.out(6875): -onPostResume
07-16 19:46:41.522: I/System.out(6875): -onPause
07-16 19:46:41.522: I/System.out(6875): -onStop
07-16 19:46:41.522: I/System.out(6875): -onDestroy
07-16 19:46:41.604: I/System.out(6875): -onCreate
07-16 19:46:41.612: I/System.out(6875): -onStart
07-16 19:46:41.616: I/System.out(6875): -onResume
07-16 19:46:41.616: I/System.out(6875): -onPostResume
Why onDestroy run twiсe? How to fix it?
This problem found in Android 2.2. In Android 2.3.3 onDestroy never called!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…