mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 12:02:16 +02:00
fixed the crash that occured due to getResources()
error (#13086)
This commit is contained in:
parent
d6bbea76da
commit
385afba7a5
@ -408,6 +408,9 @@ open class DeckPicker :
|
||||
// Then set theme and content view
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
asyncMessageContent = resources.getString(R.string.import_interrupted)
|
||||
asyncMessageTitle = resources.getString(R.string.import_title)
|
||||
|
||||
// handle the first load: display the app introduction
|
||||
if (!hasShownAppIntro()) {
|
||||
val appIntro = Intent(this, IntroductionActivity::class.java)
|
||||
@ -2463,6 +2466,13 @@ open class DeckPicker :
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
/** Import Error variable so to access the resource directory without
|
||||
* causing a crash
|
||||
*/
|
||||
lateinit var asyncMessageContent: String
|
||||
lateinit var asyncMessageTitle: String
|
||||
|
||||
/**
|
||||
* Result codes from other activities
|
||||
*/
|
||||
|
@ -18,6 +18,8 @@ package com.ichi2.anki.dialogs
|
||||
|
||||
import android.os.Bundle
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.ichi2.anki.DeckPicker.Companion.asyncMessageContent
|
||||
import com.ichi2.anki.DeckPicker.Companion.asyncMessageTitle
|
||||
import com.ichi2.anki.R
|
||||
import timber.log.Timber
|
||||
import java.net.URLDecoder
|
||||
@ -78,12 +80,12 @@ class ImportDialog : AsyncDialogFragment() {
|
||||
|
||||
override val notificationMessage: String
|
||||
get() {
|
||||
return resources.getString(R.string.import_interrupted)
|
||||
return asyncMessageContent
|
||||
}
|
||||
|
||||
override val notificationTitle: String
|
||||
get() {
|
||||
return resources.getString(R.string.import_title)
|
||||
return asyncMessageTitle
|
||||
}
|
||||
|
||||
fun dismissAllDialogFragments() {
|
||||
|
Loading…
Reference in New Issue
Block a user