Moved "Importing" toast

This commit is contained in:
merkost 2023-07-22 22:54:05 +10:00
parent 39ca2d6079
commit e244fd5a53
2 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}

View File

@ -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)