max count int maxCount = 5; intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, maxCount) //Set to video only intent.type = "video/*" //Launch Picker startActivityForResult(intent, PHOTO_PICKER_REQUEST_CODE)
{ REQUEST_PHOTO_PICKER_SINGLE_SELECT -> { val currentUri: Uri = data.data // Do stuff with the photo/video URI. } REQUEST_PHOTO_PICKER_MULTI_SELECT -> { // Get photo picker response for multi select. data.clipData.forEach { clipData -> val uri = clipData.uri // Do stuff with the photo/video URI. } } } }
{ REQUEST_PHOTO_PICKER_SINGLE_SELECT -> { val currentUri: Uri = data.data // Do stuff with the photo/video URI. } REQUEST_PHOTO_PICKER_MULTI_SELECT -> { // Get photo picker response for multi select. data.clipData.forEach { clipData -> val uri = clipData.uri // Do stuff with the photo/video URI. } } } }
{ REQUEST_PHOTO_PICKER_SINGLE_SELECT -> { val currentUri: Uri = data.data // Do stuff with the photo/video URI. } REQUEST_PHOTO_PICKER_MULTI_SELECT -> { // Get photo picker response for multi select. data.clipData.forEach { clipData -> val uri = clipData.uri // Do stuff with the photo/video URI. } } } }
list //Set selected locale val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("xx-YY") AppCompatDelegate.setApplicationLocales(appLocale)
- MUST ask permission explicitly If the apps targets Android 12 and lower - System will ask permission when first notification channel is created. Notification Permission
has enabled notification before and has existing notification channel. If the app targets Android 13 - The grant lasts until user launches the app If the apps targets Android 12 and lower - The grant lasts until user select an option from permission prompt Notification Permission