Android Question GestureDetector event for end of drag action ...

gragey

Member
Licensed User
Longtime User
Hello
I'm using GestureDetector library V2.4
Just a question : I search to detect the end of a drag action.
OnDown is OK for the beginning but OnUp is missing ...

If you have an idea.

Thanks

Gilles
 

gragey

Member
Licensed User
Longtime User
Thank you Erel
I use now the onTouch Event whith the ACTION_UP action and the function is OK.
 
Upvote 0

rp.es

Member
i use onTouch event with the Action_up action and call another sub to do some checking and then return true but it sometimes give me a exception


java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:111) at android.view.View.dispatchTouchEvent(View.java:12536) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3153) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2829) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2786) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2786) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2786) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2786) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:601) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871) at android.app.Activity.dispatchTouchEvent(Activity.java:3384) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:563) at android.view.View.dispatchPointerEvent(View.java:12788) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5670) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5465) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5011) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4977):
Sub Gesture2_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
    Try
        If Action = Activity.ACTION_UP Then DragComplete
    Catch
        Log(LastException)
    End Try

    Return True
End Sub
 
Upvote 0
Top