Skip to content
Snippets Groups Projects
Commit ef76292a authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Write permission dialog: sanity check

parent 80618c50
No related branches found
No related tags found
No related merge requests found
Pipeline #6105 passed with stage
in 4 minutes and 16 seconds
......@@ -36,6 +36,7 @@ class WriteExternalDelegate : BaseHeadlessFragment() {
builder.setMessage(R.string.sdcard_permission_dialog_message)
.setTitle(R.string.sdcard_permission_dialog_title)
.setPositiveButton(R.string.ok) { _, _ ->
if (!isAdded || isDetached) return@setPositiveButton
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
storage = arguments?.getString(KEY_STORAGE_PATH)?.apply { intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Uri.parse(this)) }
startActivityForResult(intent, REQUEST_CODE_STORAGE_ACCESS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment