mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-16 16:27:23 +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() {
|
private fun tryOpenFile() {
|
||||||
if (hasReadStoragePermission()) {
|
if (hasWriteStoragePermission()) {
|
||||||
openFile()
|
openFile()
|
||||||
} else {
|
} 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