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