5

My application playing HTML promotions in WebView, Html promotions having text so if user press long click android standard dialog appear Copy/Share/Find/Web Search, so is there any option to disable text selection dialog for webview ?

Help me on the same.

Hiren Patel
  • 52,124
  • 21
  • 173
  • 151
Dale
  • 131
  • 2
  • 5
  • http://stackoverflow.com/questions/5107651/android-disable-text-selection-in-a-webview The first aswer with javascript works perfect. – Dale Jan 11 '12 at 12:31

1 Answers1

15

You need to do this way:

WebView webView = (WebView) findViewById(R.id.webView);

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

// Below line prevent vibration on Long click
webView.setHapticFeedbackEnabled(false);

Hope this will help you.

Hiren Patel
  • 52,124
  • 21
  • 173
  • 151