|
@@ -35,8 +35,8 @@ import android.net.Uri;
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
-import android.view.View;
|
|
|
|
import android.view.KeyEvent;
|
|
import android.view.KeyEvent;
|
|
|
|
+import android.view.View;
|
|
import android.webkit.JavascriptInterface;
|
|
import android.webkit.JavascriptInterface;
|
|
import android.webkit.ValueCallback;
|
|
import android.webkit.ValueCallback;
|
|
import android.webkit.WebChromeClient;
|
|
import android.webkit.WebChromeClient;
|
|
@@ -423,8 +423,10 @@ public class RichDocumentsWebView extends ExternalSiteWebView {
|
|
@JavascriptInterface
|
|
@JavascriptInterface
|
|
public void paste() {
|
|
public void paste() {
|
|
// Javascript cannot do this by itself, so help out.
|
|
// Javascript cannot do this by itself, so help out.
|
|
- webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_PASTE));
|
|
|
|
- webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_PASTE));
|
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
|
|
+ webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_PASTE));
|
|
|
|
+ webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_PASTE));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|