Frage

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;

}

War es hilfreich?

Lösung 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

Andere Tipps

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;
}
});
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top