mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix signature of onSharedPreferenceChanged
The 'key' argument is null when called from android.app.SharedPreferencesImpl.
This commit is contained in:
@@ -147,7 +147,7 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
|
||||
|
||||
override fun onSharedPreferenceChanged(
|
||||
sharedPreferences: SharedPreferences,
|
||||
key: String
|
||||
key: String?
|
||||
) {
|
||||
if (key == "pref_widget_opacity" && widgetUpdater != null) {
|
||||
Log.d("SettingsFragment", "updating widgets")
|
||||
|
||||
@@ -79,7 +79,7 @@ class SharedPreferencesStorage
|
||||
|
||||
override fun onSharedPreferenceChanged(
|
||||
sharedPreferences: SharedPreferences,
|
||||
key: String
|
||||
key: String?
|
||||
) {
|
||||
val preferences = this.preferences ?: return
|
||||
sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
|
||||
|
||||
Reference in New Issue
Block a user