From f1b786ec3e344008475dd849f22bd8b2a27071c7 Mon Sep 17 00:00:00 2001 From: m2049r Date: Mon, 19 Oct 2020 23:42:22 +0200 Subject: [PATCH] fix keyboard crash when no view in focus (#693) --- app/src/main/java/com/m2049r/xmrwallet/util/Helper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java index db6192c..08e2323 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java @@ -167,7 +167,9 @@ public class Helper { static public void showKeyboard(Activity act) { InputMethodManager imm = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(act.getCurrentFocus(), InputMethodManager.SHOW_IMPLICIT); + final View focus = act.getCurrentFocus(); + if (focus != null) + imm.showSoftInput(focus, InputMethodManager.SHOW_IMPLICIT); } static public void hideKeyboard(Activity act) {