mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-27 05:23:00 +00:00
fixed constant activity recreate
This commit is contained in:
parent
2e24fd8ed6
commit
0f1af2e80d
1 changed files with 5 additions and 2 deletions
|
@ -129,8 +129,11 @@ open class Home : BaseFragment(), View.OnClickListener, AdapterView.OnItemSelect
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun writeToVariantPref(variant: String) {
|
private fun writeToVariantPref(variant: String) {
|
||||||
getDefaultSharedPreferences(activity).edit().putString("vanced_variant", variant).apply()
|
val prefs = getDefaultSharedPreferences(activity)
|
||||||
|
if (prefs.getString("vanced_variant", "nonroot") != variant) {
|
||||||
|
prefs.edit().putString("vanced_variant", variant).apply()
|
||||||
restartActivity()
|
restartActivity()
|
||||||
|
} else Log.d("VMvariant", "$variant is already selected")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun restartActivity() {
|
private fun restartActivity() {
|
||||||
|
|
Loading…
Reference in a new issue