Skip to content

Commit 3457a23

Browse files
[mod] Fix all issues relate to long click in Android version 7.0 (#657, #527)
1 parent 3f1ed3b commit 3457a23

File tree

1 file changed

+2
-2
lines changed
  • android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView

1 file changed

+2
-2
lines changed

android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ public void adjustFloatingContextMenuPosition() {
19661966
@Override
19671967
public void onReceiveValue(String value) {
19681968
if (floatingContextMenu != null) {
1969-
if (value != null && !value.equals("null")) {
1969+
if (value != null && !value.equalsIgnoreCase("null")) {
19701970
int x = contextMenuPoint.x;
19711971
int y = (int) ((Float.parseFloat(value) * scale) + (floatingContextMenu.getHeight() / 3.5));
19721972
contextMenuPoint.y = y;
@@ -1986,7 +1986,7 @@ public void getSelectedText(final ValueCallback<String> resultCallback) {
19861986
evaluateJavascript(getSelectedTextJS, new ValueCallback<String>() {
19871987
@Override
19881988
public void onReceiveValue(String value) {
1989-
value = (value != null) ? value.substring(1, value.length() - 1) : null;
1989+
value = (value != null && !value.equalsIgnoreCase("null")) ? value.substring(1, value.length() - 1) : null;
19901990
resultCallback.onReceiveValue(value);
19911991
}
19921992
});

0 commit comments

Comments
 (0)