mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 04:10:45 +01:00
fix #784, check storage permission before trying to import settings
This commit is contained in:
parent
1aade9c055
commit
971739631d
@ -692,14 +692,18 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun setupImportSettings() {
|
private fun setupImportSettings() {
|
||||||
settings_import_holder.setOnClickListener {
|
settings_import_holder.setOnClickListener {
|
||||||
FilePickerDialog(this) {
|
handlePermission(PERMISSION_READ_STORAGE) {
|
||||||
Thread {
|
if (it) {
|
||||||
try {
|
FilePickerDialog(this) {
|
||||||
parseFile(it)
|
Thread {
|
||||||
} catch (e: Exception) {
|
try {
|
||||||
showErrorToast(e)
|
parseFile(it)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
}.start()
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user