diff --git a/app/src/main/java/com/chiller3/bcr/RecorderTileService.kt b/app/src/main/java/com/chiller3/bcr/RecorderTileService.kt index 8afb0c6f4..8d3ce5519 100644 --- a/app/src/main/java/com/chiller3/bcr/RecorderTileService.kt +++ b/app/src/main/java/com/chiller3/bcr/RecorderTileService.kt @@ -44,7 +44,7 @@ class RecorderTileService : TileService(), SharedPreferences.OnSharedPreferenceC refreshTileState() } - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { refreshTileState() } diff --git a/app/src/main/java/com/chiller3/bcr/settings/SettingsFragment.kt b/app/src/main/java/com/chiller3/bcr/settings/SettingsFragment.kt index 64d85f59e..bccf00a3f 100644 --- a/app/src/main/java/com/chiller3/bcr/settings/SettingsFragment.kt +++ b/app/src/main/java/com/chiller3/bcr/settings/SettingsFragment.kt @@ -199,8 +199,9 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan return false } - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { when { + key == null -> return // Update the switch state if it was toggled outside of the preference (eg. from the // quick settings toggle) key == prefCallRecording.key -> {