Merge pull request #1050 from rsydor/patch-1

Fix Android Sometimes crash after close webpage and return to platform code.
This commit is contained in:
Lorenzo Pichilli 2022-04-16 01:00:02 +02:00 committed by GitHub
commit 495956f312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -1300,8 +1300,7 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
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);
}