Skip to content

Commit f83ebc6

Browse files
authored
Merge pull request #156 from nicolabeghin/master
image picker bugfix for xiaomi and huawei phones
2 parents 9363647 + d0015ae commit f83ebc6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,10 @@ public static Intent getPickImageChooserIntent(@NonNull Context context, CharSeq
175175
allIntents.addAll(galleryIntents);
176176

177177
Intent target;
178-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
178+
if (allIntents.isEmpty()) {
179179
target = new Intent();
180180
} else {
181-
target = allIntents.get(allIntents.size() - 1);
182-
allIntents.remove(allIntents.size() - 1);
181+
target = allIntents.remove(0);
183182
}
184183

185184
// Create a chooser from the main intent

0 commit comments

Comments
 (0)