change to reopen

pull/414/head
Jason Yao 4 years ago
parent e8ba0801aa
commit 9c5ac27abc
  1. 2
      app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  3. 1
      app/src/main/java/io/legado/app/utils/LanguageUtils.kt

@ -3,7 +3,6 @@ package io.legado.app.ui.config
import android.content.Intent
import android.os.Bundle
import android.os.Process
import android.util.Log
import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
@ -60,7 +59,6 @@ class ConfigActivity : VMBaseActivity<ConfigViewModel>(R.layout.activity_config)
recreate()
}
observeEvent<String>(EventBus.REOPEN) {
Log.d("h11128", "reopen")
val intent = Intent(App.INSTANCE, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
App.INSTANCE.startActivity(intent)

@ -126,7 +126,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
App.INSTANCE.getPrefBoolean(PreferKey.replaceEnableDefault, true)
PreferKey.language -> {
LanguageUtils.setConfiguration(App.INSTANCE)
postEvent(EventBus.RECREATE, "")
postEvent(EventBus.REOPEN, "")
}
}
}

@ -5,7 +5,6 @@ import android.content.res.Configuration
import android.content.res.Resources
import android.os.Build
import android.os.LocaleList
import android.util.Log
import io.legado.app.constant.PreferKey
import java.util.*

Loading…
Cancel
Save