I can create intent to choose image from gallery on Android in Kotlin like this:
val intentGallery = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
if (intentGallery.resolveActivity(activity.packageManager) != null) {
// Launch the intent
}
What do I need to put in "queries" block in "AndroidManifest" file on Android 11 (API 30) for this code to work?
Adding this code to "queries" block in "AndroidManifest" file, will make it work just fine.
<package android:name="com.google.android.apps.photos" />
But I want to add a code that covers all image galleries, not just Google's.
Reference: https://developer.android.com/training/basics/intents/package-visibility