[Libreoffice-commits] online.git: android/lib
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 11 17:55:41 UTC 2020
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 78d8906153be45bbe901138ffd1447688029483f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 11 17:53:35 2020 +0100
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Feb 11 18:55:23 2020 +0100
android: process activity result only when result is OK
This happens when the used hits the back button when asked for
the "save as" file location. Request is still sent but the result
code is not OK, and the intent is null.
Change-Id: Id3c483dc0e1e0114ff8a933072892b1f8b7c29f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88469
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 84276db97..068fae605 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -463,6 +463,10 @@ public class LOActivity extends AppCompatActivity {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+ if (resultCode != RESULT_OK) {
+ return;
+ }
+
switch (requestCode) {
case REQUEST_SELECT_IMAGE_FILE:
if (valueCallback == null)
@@ -481,6 +485,9 @@ public class LOActivity extends AppCompatActivity {
case REQUEST_SAVEAS_DOC:
case REQUEST_SAVEAS_PPT:
case REQUEST_SAVEAS_XLS:
+ if (intent == null) {
+ return;
+ }
String format = getFormatForRequestCode(requestCode);
if (format != null) {
final File tempFile = new File(LOActivity.this.getCacheDir(), "temp.file");
More information about the Libreoffice-commits
mailing list