Cordova:如何在Android中禁用双击复制/粘贴选项?

Cordova:如何在Android中禁用双击复制/粘贴选项?,android,cordova,cordova-plugins,Android,Cordova,Cordova Plugins,我需要通过在整个应用程序中禁用复制/粘贴选项来保护我的cordova应用程序。我发现下面的代码工作得非常好(即,如果我们触摸并按住任何输入文本,将禁用复制/粘贴选项) 但当我双击任何输入字段文本时,复制/粘贴选项仍会显示。我也需要禁用它。我们如何才能做到这一点 谢谢 更新1: 刚刚找到了一种方法,可以使用gesturedector在双击时禁用这些选项。但这些选项仍在3次点击中出现。因此,问题仍然存在。新代码如下所示: public class CopyPasteDisabler extends

我需要通过在整个应用程序中禁用复制/粘贴选项来保护我的cordova应用程序。我发现下面的代码工作得非常好(即,如果我们触摸并按住任何输入文本,将禁用复制/粘贴选项)

但当我双击任何输入字段文本时,复制/粘贴选项仍会显示。我也需要禁用它。我们如何才能做到这一点

谢谢

更新1:

刚刚找到了一种方法,可以使用
gesturedector
在双击时禁用这些选项。但这些选项仍在3次点击中出现。因此,问题仍然存在。新代码如下所示:

public class CopyPasteDisabler extends CordovaPlugin {

    private GestureDetector mGestureDetector;

    @Override
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
        super.initialize(cordova, webView);

        mGestureDetector = new GestureDetector(cordova.getActivity(), new DoubleTapGestureDetector());

        webView.getView().setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                return mGestureDetector.onTouchEvent(motionEvent);
            }
        });

        webView.getView().setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                return true;
            }
        });
    }

    private class DoubleTapGestureDetector extends GestureDetector.SimpleOnGestureListener {

        @Override
        public boolean onDoubleTap(MotionEvent e) {
            return true;
        }

        @Override
        public boolean onDoubleTapEvent(MotionEvent e) {
            return true;
        }
    } 
}

您可以在Javascript中禁用双击,如下所示:

$("body").nodoubletapzoom();

您可以在Javascript中禁用双击,如下所示:

$("body").nodoubletapzoom();

关于这个问题,一个名叫纳辛格·托马尔(Narsingh Tomar)的家伙给出了一个很好的答案

根据这个你可以使用

`<style type="text/css">
*:not(input):not(textarea) {
  -webkit-user-select: none; /* disable selection/Copy of UIWebView */
  -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}       
</style>

**If you want Disable only anchor button tag use this.**
a {-webkit-user-select: none; /* disable selection/Copy of UIWebView */
   -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
 }`

以上代码在所有情况下都适用于我。试试看

关于这个问题,一个叫纳辛格·托马尔的家伙给出了一个很好的答案

根据这个你可以使用

`<style type="text/css">
*:not(input):not(textarea) {
  -webkit-user-select: none; /* disable selection/Copy of UIWebView */
  -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}       
</style>

**If you want Disable only anchor button tag use this.**
a {-webkit-user-select: none; /* disable selection/Copy of UIWebView */
   -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
 }`
以上代码在所有情况下都适用于我。试试看

你能试试这个吗$('#someid').dblclick(函数(e){e.preventDefault();});someid在哪里你能试试这个吗$('#someid').dblclick(函数(e){e.preventDefault();});其中someid是