diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java index 376452eb..e4c2d16f 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java @@ -1525,7 +1525,14 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie public void run() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); - if (containerView != null && imm != null && !imm.isAcceptingText()) { + boolean isAcceptingText = false; + try { + if (imm != null) { + isAcceptingText = imm.isAcceptingText(); + } + } catch (Exception ignored) { + } + if (containerView != null && imm != null && !isAcceptingText) { imm.hideSoftInputFromWindow( containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); }