diff --git a/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt b/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt index f4cb5204bd..cf6e52e98e 100644 --- a/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt +++ b/app/src/main/java/com/github/libretube/ui/preferences/BackupRestoreSettings.kt @@ -62,8 +62,8 @@ class BackupRestoreSettings : BasePreferenceFragment() { /** * result listeners for importing and exporting playlists */ - private val getPlaylistsFile = registerForActivityResult(ActivityResultContracts.GetContent()) { - it?.let { + private val getPlaylistsFile = registerForActivityResult(ActivityResultContracts.OpenMultipleDocuments()) { + it?.forEach { CoroutineScope(Dispatchers.IO).launch { ImportHelper.importPlaylists(requireActivity(), it) } @@ -94,7 +94,7 @@ class BackupRestoreSettings : BasePreferenceFragment() { val importPlaylists = findPreference("import_playlists") importPlaylists?.setOnPreferenceClickListener { - getPlaylistsFile.launch("*/*") + getPlaylistsFile.launch(arrayOf("*/*")) true }