Skip to content

Commit

Permalink
add if around intent
Browse files Browse the repository at this point in the history
  • Loading branch information
nonproto committed Feb 6, 2024
1 parent 5da9734 commit 35ecee2
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 35ecee2

Please sign in to comment.