mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-13 06:52:03 +02:00
ask write storage permissions instead of read ones at opening a file
This commit is contained in:
parent
6311a195c2
commit
588b5b08f2
@ -155,10 +155,10 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
}
|
||||
|
||||
private fun tryOpenFile() {
|
||||
if (hasReadStoragePermission()) {
|
||||
if (hasWriteStoragePermission()) {
|
||||
openFile()
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), STORAGE_OPEN_FILE)
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_OPEN_FILE)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user