Merge branch 'vespr-wallet-fix/imm'

This commit is contained in:
Lorenzo Pichilli 2023-11-10 21:12:46 +01:00
commit fd96023945
1 changed files with 18 additions and 8 deletions

View File

@ -1525,7 +1525,17 @@ 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;
if (imm != null) {
try {
// imm.isAcceptingText() seems to sometimes crash on some devices
isAcceptingText = imm.isAcceptingText();
} catch (Exception ignored) {
}
}
if (containerView != null && imm != null && !isAcceptingText) {
imm.hideSoftInputFromWindow(
containerView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}