Fix: system shell

This commit is contained in:
zt515
2017-06-18 12:14:23 +08:00
parent a2d5a8fe63
commit 5c9d7b4c43

View File

@ -261,27 +261,22 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
if (!isRecreating()) {
BaseFileInstaller.installBaseFiles(this, resultListener)
} else {
systemShell = NeoPreference.loadBoolean("system_shell", true)
}
}
override fun onSaveInstanceState(outState: Bundle?) {
super.onSaveInstanceState(outState)
outState?.putBoolean("system_shell", systemShell)
}
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
super.onRestoreInstanceState(savedInstanceState)
systemShell = savedInstanceState?.getBoolean("system_shell", true) ?: true
}
override fun recreate() {
NeoPreference.store("recreate", true)
NeoPreference.store("system_shell", systemShell)
super.recreate()
}
private fun isRecreating(): Boolean {
val result = peekRecreating()
NeoPreference.store("recreate", !result)
if (result) {
NeoPreference.store("recreate", !result)
}
return result
}