Update InAppWebView.java

Fix crash
This commit is contained in:
rsydor 2021-12-06 17:09:57 +01:00 committed by GitHub
parent f06bcdf695
commit f43c8c2c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);