mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 20:20:53 +01:00
Added invalid_file_format toast on XML importing
This commit is contained in:
parent
e244fd5a53
commit
014ac2a4cf
@ -94,6 +94,7 @@ class MessagesImporter(private val activity: SimpleActivity) {
|
||||
}
|
||||
|
||||
private fun InputStream.importXml() {
|
||||
try {
|
||||
bufferedReader().use { reader ->
|
||||
val xmlParser = Xml.newPullParser().apply {
|
||||
setInput(reader)
|
||||
@ -137,6 +138,9 @@ class MessagesImporter(private val activity: SimpleActivity) {
|
||||
messagesFailed > 0 -> activity.toast(R.string.importing_failed)
|
||||
else -> activity.toast(R.string.importing_successful)
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
activity.toast(R.string.invalid_file_format)
|
||||
}
|
||||
}
|
||||
|
||||
private fun XmlPullParser.readSms(): SmsBackup {
|
||||
|
Loading…
x
Reference in New Issue
Block a user