mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:35:10 +08:00
Bugfix issue 665 (#700)
* GH-665 - store the imageFilePath when the app is paused (onSaveInstance) and restore it back. * Update src/android/CameraLauncher.java whitespace layout Co-authored-by: Tim Brust <github@timbrust.de> Co-authored-by: Tim Brust <github@timbrust.de>
This commit is contained in:
parent
b43c78b419
commit
f704689200
@ -92,6 +92,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
private static final String GET_All = "Get All";
|
private static final String GET_All = "Get All";
|
||||||
private static final String CROPPED_URI_KEY = "croppedUri";
|
private static final String CROPPED_URI_KEY = "croppedUri";
|
||||||
private static final String IMAGE_URI_KEY = "imageUri";
|
private static final String IMAGE_URI_KEY = "imageUri";
|
||||||
|
private static final String IMAGE_FILE_PATH_KEY = "imageFilePath";
|
||||||
|
|
||||||
private static final String TAKE_PICTURE_ACTION = "takePicture";
|
private static final String TAKE_PICTURE_ACTION = "takePicture";
|
||||||
|
|
||||||
@ -1350,6 +1351,10 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
state.putString(IMAGE_URI_KEY, this.imageFilePath);
|
state.putString(IMAGE_URI_KEY, this.imageFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.imageFilePath != null) {
|
||||||
|
state.putString(IMAGE_FILE_PATH_KEY, this.imageFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1375,6 +1380,10 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
this.imageUri = Uri.parse(state.getString(IMAGE_URI_KEY));
|
this.imageUri = Uri.parse(state.getString(IMAGE_URI_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state.containsKey(IMAGE_FILE_PATH_KEY)) {
|
||||||
|
this.imageFilePath = state.getString(IMAGE_FILE_PATH_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
this.callbackContext = callbackContext;
|
this.callbackContext = callbackContext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user