mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix #784, check storage permission before trying to import settings
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user