From a01792ac9a71689ef5d13a7ab4e71d7a97966062 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 25 Mar 2021 13:56:39 -0400 Subject: [PATCH] Maybe make opening file picker for choosing backup file more reliable --- .../java/eu/kanade/tachiyomi/ui/manga/MangaController.kt | 5 +++-- .../tachiyomi/ui/setting/SettingsBackupController.kt | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index f0b7f36240..597fcfb4e5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -609,8 +609,9 @@ class MangaController : override fun openMangaCoverPicker(manga: Manga) { if (manga.favorite) { - val intent = Intent(Intent.ACTION_GET_CONTENT) - intent.type = "image/*" + val intent = Intent(Intent.ACTION_GET_CONTENT).apply { + type = "image/*" + } startActivityForResult( Intent.createChooser( intent, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index e27149a215..803148de45 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -82,9 +82,10 @@ class SettingsBackupController : SettingsController() { onClick { if (!BackupRestoreService.isRunning(context)) { - val intent = Intent(Intent.ACTION_GET_CONTENT) - intent.addCategory(Intent.CATEGORY_OPENABLE) - intent.type = "application/*" + val intent = Intent(Intent.ACTION_GET_CONTENT).apply { + addCategory(Intent.CATEGORY_OPENABLE) + type = "*/*" + } val title = resources?.getString(R.string.file_select_backup) val chooser = Intent.createChooser(intent, title) startActivityForResult(chooser, CODE_BACKUP_RESTORE)