I am using css columns to display contents in android webview. I used longclicklistner {return true}; with this I was able to disable longclick in phones but it doesn't seem to work in tabs(eg galaxy tab 2). I'm also preventing touchmove event using jquery but the css columns are moving when swipe occurs as part of longclick. Any help is welcome. Thank you.

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;

}

有帮助吗?

解决方案 2

I avoided using GestureDetector and SimpleOnGestureListener, I done it with catching touch listnerby catching the position fron MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP

其他提示

You have to use a GestureDetector, the SimpleOnGestureListener has onSingleTapConfirmed() for click events and onFling() for swipe events.

Refer this

Try this :

_webview.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
    return true;
}
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top