imm crash fix
This commit is contained in:
parent
0157c8ec7c
commit
b3b8923014
|
@ -1525,7 +1525,14 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
public void run() {
|
public void run() {
|
||||||
InputMethodManager imm =
|
InputMethodManager imm =
|
||||||
(InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
(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(
|
imm.hideSoftInputFromWindow(
|
||||||
containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue