mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-13 23:12:02 +02:00
show the Note Exported Successfully message only once it really happened
This commit is contained in:
parent
8642731427
commit
900e5bb1bc
@ -330,19 +330,24 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
flush()
|
||||
close()
|
||||
}
|
||||
noteExportedSuccessfully(path.getFilenameFromPath())
|
||||
}
|
||||
} else {
|
||||
file.printWriter().use { out ->
|
||||
out.write(content)
|
||||
}
|
||||
noteExportedSuccessfully(path.getFilenameFromPath())
|
||||
}
|
||||
val message = String.format(getString(R.string.note_exported_successfully), path.getFilenameFromPath())
|
||||
toast(message)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
|
||||
private fun noteExportedSuccessfully(title: String) {
|
||||
val message = String.format(getString(R.string.note_exported_successfully), title)
|
||||
toast(message)
|
||||
}
|
||||
|
||||
fun noteSavedSuccessfully(title: String) {
|
||||
if (config.displaySuccess) {
|
||||
val message = String.format(getString(R.string.note_saved_successfully), title)
|
||||
|
Loading…
x
Reference in New Issue
Block a user