Disable long click in android web browser

I am using css columns to display content in an android web browser. I used longclicklistner {return true}; with this, I was able to disable longclick in phones, but it doesn’t work in tabs (e.g. galaxy 2 tab). I also prevent a touchmove event using jquery, but css columns move when swipe events occur as part of a longclick. Any help is appreciated. Thanks.

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

Jquery code:

 document.getElementById("divIdToShowContent").ontouchmove = function(e){ e.preventDefault(); var touching = null; 

}

+6
source share
3 answers

I avoided using the GestureDetector and SimpleOnGestureListener, I did this using the touchnerby trap, catching the position fron MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP

0
source

You must use the GestureDetector , SimpleOnGestureListener has onSingleTapConfirmed() for click events and onFling() for translation events.

Refer this

0
source

Try the following:

 _webview.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { return true; } }); 
0
source

Source: https://habr.com/ru/post/944354/


All Articles