Skip to content

Commit

Permalink
image picker bugfix for xiaomi and huawei phones
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolabeghin committed Aug 31, 2016
1 parent 9363647 commit d0015ae
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,10 @@ public static Intent getPickImageChooserIntent(@NonNull Context context, CharSeq
allIntents.addAll(galleryIntents);

Intent target;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (allIntents.isEmpty()) {
target = new Intent();
} else {
target = allIntents.get(allIntents.size() - 1);
allIntents.remove(allIntents.size() - 1);
target = allIntents.remove(0);
}

// Create a chooser from the main intent
Expand Down

0 comments on commit d0015ae

Please sign in to comment.