From f43c8c2c681506d590b181906b923b24e4d5032b Mon Sep 17 00:00:00 2001 From: rsydor <79581663+rsydor@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:09:57 +0100 Subject: [PATCH 1/2] Update InAppWebView.java Fix crash --- .../flutter_inappwebview/in_app_webview/InAppWebView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java index dcde9159..63354eed 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java @@ -1302,7 +1302,7 @@ final public class InAppWebView extends InputAwareWebView { public void run() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); - if (imm != null && !imm.isAcceptingText()) { + if (containerView!=null && imm != null && !imm.isAcceptingText()) { imm.hideSoftInputFromWindow( containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); From 96b6525781d1896c866738eb7f81ef4c1ba1fbc5 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Sat, 16 Apr 2022 00:59:44 +0200 Subject: [PATCH 2/2] Update InAppWebView.java --- .../flutter_inappwebview/in_app_webview/InAppWebView.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java index 63354eed..890761f9 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java @@ -1302,8 +1302,7 @@ final public class InAppWebView extends InputAwareWebView { public void run() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); - if (containerView!=null && imm != null && !imm.isAcceptingText()) { - + if (containerView != null && imm != null && !imm.isAcceptingText()) { imm.hideSoftInputFromWindow( containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); }