From 3457a239fe393e0bc73f25bb3342dcb858eb92fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tra=CC=82=CC=80n=20=C4=90u=CC=9B=CC=81c=20Ta=CC=82m?= Date: Mon, 8 Feb 2021 17:35:00 +0900 Subject: [PATCH] [mod] Fix all issues relate to long click in Android version 7.0 (#657, #527) --- .../flutter_inappwebview/InAppWebView/InAppWebView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java index 0ff3a5c1..b27d0285 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java @@ -1966,7 +1966,7 @@ final public class InAppWebView extends InputAwareWebView { @Override public void onReceiveValue(String value) { if (floatingContextMenu != null) { - if (value != null && !value.equals("null")) { + if (value != null && !value.equalsIgnoreCase("null")) { int x = contextMenuPoint.x; int y = (int) ((Float.parseFloat(value) * scale) + (floatingContextMenu.getHeight() / 3.5)); contextMenuPoint.y = y; @@ -1986,7 +1986,7 @@ final public class InAppWebView extends InputAwareWebView { evaluateJavascript(getSelectedTextJS, new ValueCallback() { @Override public void onReceiveValue(String value) { - value = (value != null) ? value.substring(1, value.length() - 1) : null; + value = (value != null && !value.equalsIgnoreCase("null")) ? value.substring(1, value.length() - 1) : null; resultCallback.onReceiveValue(value); } });