From 2996c63981b97417f8bbbf67820e2c54b60e769a Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Tue, 20 Sep 2016 20:41:25 +0200 Subject: [PATCH] Fixed a bug where on Lolipop+ one could only append one image to a post --- .../dfa/diaspora_android/activity/MainActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index 22dbd5d8..95c9cbbf 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -430,9 +430,7 @@ public class MainActivity extends AppCompatActivity } } - AppLog.v(this, "onOpenFileChooser"); - if (imageUploadFilePathCallbackNew != null) - imageUploadFilePathCallbackNew.onReceiveValue(null); + AppLog.v(MainActivity.this, "onOpenFileChooser"); imageUploadFilePathCallbackNew = filePathCallback; Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); @@ -623,6 +621,8 @@ public class MainActivity extends AppCompatActivity if (imageUploadFilePathCallbackNew == null || resultCode != Activity.RESULT_OK) { AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackNew == null) + " resultCode: " + resultCode); + if(imageUploadFilePathCallbackNew != null) + imageUploadFilePathCallbackNew.onReceiveValue(new Uri[]{}); return; } Uri[] results = null; @@ -651,6 +651,8 @@ public class MainActivity extends AppCompatActivity if (imageUploadFilePathCallbackOld == null || resultCode != Activity.RESULT_OK) { AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackOld == null) + " resultCode: " + resultCode); + if(imageUploadFilePathCallbackOld != null) + imageUploadFilePathCallbackOld.onReceiveValue(null); return; } Uri results = null;