change get_content intent to an open_document one with persistent read uri perm

This commit is contained in:
tibbi
2018-03-29 16:35:57 +02:00
parent 4c9c5e0c7e
commit 2dd62ab3c6
2 changed files with 8 additions and 1 deletions

View File

@ -83,9 +83,10 @@ class SelectAlarmSoundDialog(val activity: SimpleActivity, val currentUri: Strin
private fun alarmClicked(alarmSound: AlarmSound) {
if (alarmSound.id == ADD_NEW_SOUND_ID) {
Intent(Intent.ACTION_GET_CONTENT).apply {
Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
type = "audio/*"
activity.startActivityForResult(this, PICK_AUDIO_FILE_INTENT_ID)
flags = flags or Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
}
dialog.dismiss()
} else {