photo_picker.kt //If version > 13 val intent = Intent(MediaStore.ACTION_PICK_IMAGES) //Setup 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)
photo_picker.kt override fun onActivityResult(...) { //if result ok when (requestCode) { 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. } } } }
photo_picker.kt override fun onActivityResult(...) { //if result ok when (requestCode) { 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. } } } }
photo_picker.kt override fun onActivityResult(...) { //if result ok when (requestCode) { 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. } } } }
language_pref.kt val localeList = AppCompatDelegate.getApplicationLocales() //Show custom picker with locale list //Set selected locale val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("xx-YY") AppCompatDelegate.setApplicationLocales(appLocale)
On newly installed app If the app targets Android 13 - MUST ask permission explicitly If the apps targets Android 12 and lower - System will ask permission when first notification channel is created. Notification Permission
On existing app A temporary grant is given if user 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
Foreground Service Manager Getting killed by FGS Manager does not kill your scheduled jobs and alarms. The system will alert user to interact with your active task if it runs for more than 20 hours in a day.
Other changes “Restricted” bucket changes “NEARBY_WIFI_DEVICE” permission added Body sensor background permission added Quick Settings placement API Revoke permission API BLE Audio support MIDI 2.0 Color vector fonts