Moved "Importing" toast
This commit is contained in:
parent
39ca2d6079
commit
e244fd5a53
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue