ask write storage permissions instead of read ones at opening a file

This commit is contained in:
tibbi 2017-03-08 20:09:36 +01:00
parent 6311a195c2
commit 588b5b08f2

View File

@ -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)
}
}