Вопрос

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