2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-07 01:25:09 +00:00

Hopefully fix some NPE crashes

This commit is contained in:
Albert Vaca Cintora
2022-01-24 01:09:43 +01:00
parent 5ef7154d5e
commit 2d55f282a8
2 changed files with 5 additions and 2 deletions

View File

@@ -414,7 +414,8 @@ public class RemoteKeyboardPlugin extends Plugin implements SharedPreferences.On
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(context.getString(R.string.remotekeyboard_editing_only))) {
final boolean editingOnly = sharedPreferences.getBoolean(context.getString(R.string.remotekeyboard_editing_only), true);
notifyKeyboardState(editingOnly ? RemoteKeyboardService.instance.visible : true);
final boolean visible = RemoteKeyboardService.instance != null && RemoteKeyboardService.instance.visible;
notifyKeyboardState(!editingOnly || visible);
}
}
}