diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index ca92f48f27d..aec66a41d0f 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.13+6 + +* Fixes an Android issue where `pickMedia` allowed non-image files to be selected. + ## 0.8.13+5 * Updates Java compatibility version to 17 and minimum supported SDK version to Flutter 3.35/Dart 3.9. diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java index 043546de2b3..a2b564c704e 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java @@ -322,7 +322,7 @@ private void launchPickMediaFromGalleryIntent(Messages.GeneralOptions generalOpt pickMediaIntent = new Intent(Intent.ACTION_GET_CONTENT); pickMediaIntent.setType("*/*"); String[] mimeTypes = {"video/*", "image/*"}; - pickMediaIntent.putExtra("CONTENT_TYPE", mimeTypes); + pickMediaIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); pickMediaIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, generalOptions.getAllowMultiple()); } activity.startActivityForResult(pickMediaIntent, REQUEST_CODE_CHOOSE_MEDIA_FROM_GALLERY); diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index 4014bcd5d42..cff3b83c248 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker_android description: Android implementation of the image_picker plugin. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 0.8.13+5 +version: 0.8.13+6 environment: sdk: ^3.9.0