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>
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index 32a27d4..070cef8 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -92,6 +92,7 @@
private static final String GET_All = "Get All";
private static final String CROPPED_URI_KEY = "croppedUri";
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";
@@ -1350,6 +1351,10 @@
state.putString(IMAGE_URI_KEY, this.imageFilePath);
}
+ if (this.imageFilePath != null) {
+ state.putString(IMAGE_FILE_PATH_KEY, this.imageFilePath);
+ }
+
return state;
}
@@ -1375,6 +1380,10 @@
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;
}
}