aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java5
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
index 9b80db16..50109df3 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
@@ -378,7 +378,10 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
}
public void selectImage() {
-
+ Intent intent = new Intent();
+ intent.setType("image/*");
+ intent.setAction(Intent.ACTION_GET_CONTENT);
+ startActivityForResult(Intent.createChooser(intent, resources.getString(R.string.select_from_gallery)), PICK_IMAGE_REQUEST_CODE);
}
public void captureImage() {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java
index a03d28ec..b81f235b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/RedditGallerySubmissionRecyclerViewAdapter.java
@@ -121,6 +121,9 @@ public class RedditGallerySubmissionRecyclerViewAdapter extends RecyclerView.Ada
}
public void addImage(String imageUrl) {
+ if (redditGalleryImageInfoList == null) {
+ redditGalleryImageInfoList = new ArrayList<>();
+ }
redditGalleryImageInfoList.add(new RedditGalleryImageInfo(imageUrl));
notifyItemInserted(redditGalleryImageInfoList.size() - 1);
}