From e244fd5a53058ab3a180ab24c97af0465d8dd727 Mon Sep 17 00:00:00 2001 From: merkost Date: Sat, 22 Jul 2023 22:54:05 +1000 Subject: [PATCH] Moved "Importing" toast --- .../smsmessenger/activities/SettingsActivity.kt | 1 - .../simplemobiletools/smsmessenger/helpers/MessagesImporter.kt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) 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)