From 35ecee2649933b2045928ed2e736249231fdde9f Mon Sep 17 00:00:00 2001 From: nonproto <2092019+nonproto@users.noreply.github.com> Date: Tue, 6 Feb 2024 13:28:38 -0500 Subject: [PATCH] add if around intent --- .../tachiyomi/ui/setting/SettingsDataController.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDataController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDataController.kt index 02763df78a..54e2ad472d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDataController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDataController.kt @@ -5,6 +5,7 @@ import android.app.Dialog import android.content.ActivityNotFoundException import android.content.Intent import android.net.Uri +import android.os.Build import android.os.Bundle import android.provider.DocumentsContract import android.view.View @@ -190,10 +191,12 @@ class SettingsDataController : SettingsController() { addCategory(Intent.CATEGORY_OPENABLE) setDataAndType(storageManager.getBackupDirectory()!!.uri, "application/*") putExtra(Intent.EXTRA_TITLE, Backup.getBackupFilename()) - putExtra( - DocumentsContract.EXTRA_INITIAL_URI, - storageManager.getBackupDirectory()!!.uri - ) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + putExtra( + DocumentsContract.EXTRA_INITIAL_URI, + storageManager.getBackupDirectory()!!.uri + ) + } } startActivityForResult(intent, CODE_BACKUP_CREATE)