diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index 0d8bb010d..8261fa726 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -65,9 +65,8 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { putPrefBoolean(PreferKey.webService, WebService.isRun) addPreferencesFromResource(R.xml.pref_main) - val webServicePre = findPreference(PreferKey.webService) observeEventSticky(EventBus.WEB_SERVICE) { - webServicePre?.let { + findPreference(PreferKey.webService)?.let { it.isChecked = WebService.isRun it.summary = if (WebService.isRun) { WebService.hostAddress