4

enter image description herePhone Gap issue-

How to disable the default text copy-paste functionality for ANDROID as well as IOS which is coming after long press on screen in Phonegap application.

I referred How to disable the default behavior of an Anchor in jQuery Mobile (iOS), but it is not feasible solution. I want code in config.xml file.

Thanks.

Community
  • 1
  • 1
user3345202
  • 41
  • 1
  • 6

2 Answers2

6
**Use below code:**
<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 */
 }
Narsingh Tomar
  • 487
  • 5
  • 15
0

Try this in main Activity on the MainActivity where you are doing loadUrl(launchUrl); paste After oncreate method

 super.appView.getView().setOnLongClickListener(new View.OnLongClickListener() {

            public boolean onLongClick(View v) {
                return true;
            }
        });

this will prevent copy on long press

Ashish
  • 99
  • 4