mirror of
https://github.com/videolan/vlc-android
synced 2024-11-23 18:05:36 +08:00
Fix IllegalStateException
This commit is contained in:
parent
344be73e6e
commit
3daead8e57
@ -56,13 +56,22 @@ class PreferencesRemoteAccess : BasePreferenceFragment(), SharedPreferences.OnSh
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
|
|
||||||
if(!settings.getBoolean(REMOTE_ACCESS_ONBOARDING, false)) {
|
if(!settings.getBoolean(REMOTE_ACCESS_ONBOARDING, false)) {
|
||||||
settings.putSingle(REMOTE_ACCESS_ONBOARDING, true)
|
settings.putSingle(REMOTE_ACCESS_ONBOARDING, true)
|
||||||
startActivity(Intent(Intent.ACTION_VIEW).apply { setClassName(activity, REMOTE_ACCESS_ONBOARDING) })
|
startActivity(Intent(Intent.ACTION_VIEW).apply { setClassName(activity, REMOTE_ACCESS_ONBOARDING) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
preferenceScreen.sharedPreferences!!.unregisterOnSharedPreferenceChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
|
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
|
||||||
super.onCreatePreferences(bundle, s)
|
super.onCreatePreferences(bundle, s)
|
||||||
settings = Settings.getInstance(activity)
|
settings = Settings.getInstance(activity)
|
||||||
|
@ -56,13 +56,22 @@ class PreferencesRemoteAccess : BasePreferenceFragment(), SharedPreferences.OnSh
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
|
|
||||||
if(!settings.getBoolean(REMOTE_ACCESS_ONBOARDING, false)) {
|
if(!settings.getBoolean(REMOTE_ACCESS_ONBOARDING, false)) {
|
||||||
settings.putSingle(REMOTE_ACCESS_ONBOARDING, true)
|
settings.putSingle(REMOTE_ACCESS_ONBOARDING, true)
|
||||||
startActivity(Intent(Intent.ACTION_VIEW).apply { setClassName(requireActivity(), REMOTE_ACCESS_ONBOARDING) })
|
startActivity(Intent(Intent.ACTION_VIEW).apply { setClassName(requireActivity(), REMOTE_ACCESS_ONBOARDING) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
preferenceScreen.sharedPreferences!!.unregisterOnSharedPreferenceChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
|
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
|
||||||
super.onCreatePreferences(bundle, s)
|
super.onCreatePreferences(bundle, s)
|
||||||
settings = Settings.getInstance(requireActivity())
|
settings = Settings.getInstance(requireActivity())
|
||||||
|
Loading…
Reference in New Issue
Block a user