Merge pull request #263 from AlexVincent525/fix-crash-when-prompt-called-on-android-q

Fix crash when `prompt` was called on Android Q.
This commit is contained in:
Lorenzo Pichilli 2020-05-09 04:37:45 +02:00 committed by GitHub
commit 13b9d8050d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package com.pichillilorenzo.flutter_inappwebview.InAppWebView;
import static android.content.Context.INPUT_METHOD_SERVICE;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
@ -190,7 +191,11 @@ public class InputAwareWebView extends WebView {
// onCreateInputConnection() on targetView on the same thread as
// targetView.getHandler(). It will also call subsequent InputConnection methods on this
// thread. This is the IME thread in cases where targetView is our proxyAdapterView.
imm.isActive(containerView);
// TODO (ALexVincent525): Currently only prompt has been tested, still needs more test cases.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
imm.isActive(containerView);
}
}
});
}