diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt index 094f5e56..12c845f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt @@ -80,7 +80,6 @@ class SettingsActivity : SimpleActivity() { private val getContent = registerForActivityResult(ActivityResultContracts.OpenDocument()) { uri -> if (uri != null) { - toast(R.string.importing) MessagesImporter(this).importMessages(uri) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt index b3e625b8..e9a70bf8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/MessagesImporter.kt @@ -29,6 +29,7 @@ class MessagesImporter(private val activity: SimpleActivity) { val fileType = activity.contentResolver.getType(uri).orEmpty() val isXml = isXmlMimeType(fileType) || (uri.path?.endsWith("txt") == true && isFileXml(uri)) if (isXml) { + activity.toast(R.string.importing) getInputStreamFromUri(uri)!!.importXml() } else { importJson(uri)