fix #784, check storage permission before trying to import settings

This commit is contained in:
tibbi 2019-02-14 21:18:07 +01:00
parent 1aade9c055
commit 971739631d
1 changed files with 11 additions and 7 deletions

View File

@ -692,14 +692,18 @@ class SettingsActivity : SimpleActivity() {
private fun setupImportSettings() {
settings_import_holder.setOnClickListener {
FilePickerDialog(this) {
Thread {
try {
parseFile(it)
} catch (e: Exception) {
showErrorToast(e)
handlePermission(PERMISSION_READ_STORAGE) {
if (it) {
FilePickerDialog(this) {
Thread {
try {
parseFile(it)
} catch (e: Exception) {
showErrorToast(e)
}
}.start()
}
}.start()
}
}
}
}