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:
Pieter Van Poyer 2021-02-02 19:43:26 +01:00 committed by GitHub
parent b43c78b419
commit f704689200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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;
}
}