Android Question GestureDetector onTouch event error 'boolean java.lang.Boolean.booleanValue()'

rp.es

Member
I'm using 3 GestureDetectors for 3 panel that are sliding horizontally in activity with onDrag event( i change panels left).
And i need to detect the end of a drag action, so i use onTouch event to detect that. i have some checking in onTouch event and then return true .
The problem i sometime get the 'boolean java.lang.Boolean.booleanValue()' exception . not always but sometimes. i thing i am not suppose to write anything in onTouch event, but i dont know where to put it.any idea how to avoid the 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:2844) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2844) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2844) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2844) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3159) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2844) 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):
Sub Gesture1_onDrag(deltaX As Float, deltaY As Float, MotionEvent As Object)
    Try
        pnlSlide(1).Left = Max(0, Min(pnlSlide(1).Left + deltaX, 100%x - pnlSlide(1).Width))
    Catch
        Log(LastException)
    End Try
    
End Sub

Sub Gesture1_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
 
Top