File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
app/src/main/kotlin/com/simplemobiletools/notes/pro/activities Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,13 @@ class MainActivity : SimpleActivity() {
237237 override fun onActivityResult (requestCode : Int , resultCode : Int , resultData : Intent ? ) {
238238 super .onActivityResult(requestCode, resultCode, resultData)
239239 if (requestCode == PICK_OPEN_FILE_INTENT && resultCode == RESULT_OK && resultData != null && resultData.data != null ) {
240+ val takeFlags = Intent .FLAG_GRANT_READ_URI_PERMISSION or Intent .FLAG_GRANT_WRITE_URI_PERMISSION
241+ applicationContext.contentResolver.takePersistableUriPermission(resultData.data!! , takeFlags)
242+
240243 importUri(resultData.data!! )
241244 } else if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity .RESULT_OK && resultData != null && resultData.data != null && mNotes.isNotEmpty()) {
245+ val takeFlags = Intent .FLAG_GRANT_READ_URI_PERMISSION or Intent .FLAG_GRANT_WRITE_URI_PERMISSION
246+ applicationContext.contentResolver.takePersistableUriPermission(resultData.data!! , takeFlags)
242247 showExportFilePickUpdateDialog(resultData.dataString!! , getCurrentNoteValue())
243248 }
244249 }
You can’t perform that action at this time.
0 commit comments