fix #156, properly switch language after toggling Use english

This commit is contained in:
tibbi
2018-03-31 14:24:08 +02:00
parent 09275e6b95
commit 960b99d6f3
3 changed files with 6 additions and 23 deletions

View File

@ -38,8 +38,6 @@ class MainActivity : SimpleActivity() {
private var wasBackJustPressed = false
private var searchMenuItem: MenuItem? = null
private var storedUseEnglish = false
private lateinit var fragment: ItemsFragment
override fun onCreate(savedInstanceState: Bundle?) {
@ -59,20 +57,6 @@ class MainActivity : SimpleActivity() {
checkWhatsNewDialog()
checkIfRootAvailable()
storeStateVariables()
}
override fun onResume() {
super.onResume()
if (storedUseEnglish != config.useEnglish) {
restartActivity()
return
}
}
override fun onPause() {
super.onPause()
storeStateVariables()
}
override fun onStop() {
@ -132,10 +116,6 @@ class MainActivity : SimpleActivity() {
openPath(savedInstanceState.getString(PICKED_PATH), true)
}
private fun storeStateVariables() {
storedUseEnglish = config.useEnglish
}
private fun setupSearch(menu: Menu) {
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
searchMenuItem = menu.findItem(R.id.search)