Can some one help me with this error code?

Yafuhenk

Active Member
Licensed User
Longtime User
Sometimes my programm crashes. It might be due to this error.
B4X:
java.lang.RuntimeException: MotionEvent { action=ACTION_UP, id[0]=0, x[0]=63.74283, y[0]=25.806656, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=13894859, downTime=13894665, deviceId=2, source=0x1002 } recycled twice!
   at android.view.MotionEvent.recycle(MotionEvent.java:1660)
   at android.view.ViewRootImpl.finishMotionEvent(ViewRootImpl.java:2921)
   at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2912)
   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2471)
   at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:849)
   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2480)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:4424)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
   at dalvik.system.NativeStart.main(Native Method)

Does it refer to a button_up action? I don't have this in my entire code?
If some one can tell me some more about this error than I higly appreciate a feedback.

Henk
 

pluton

Active Member
Licensed User
Longtime User
It says MotionEvent action=ACTION_UP

So it has something with your drag function to up.
If you don't post part of code or entire code here it is difficult to help you
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Thanks for the fast reply.
I searched my entire code for ´touch´, ´swipe´, ´_up´. Result: no hits at all.
The issue is that I don't get the error all the time.

The program only works with a database with figures I am not allowed to share.
Posting the code doesn't therefore make much sense I assume
I will try to repeat the error and will come to you.

Thanks

Henk
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi,

OK in the mean time I think I know that the error (see #1) pops up when I include the Reflection library. I need this library however for making screenshots.
Whatever I did I can´t get rid of the error.
The problem for testing is however that the error is not always there.
I will add some code and I hope some of you are willing to test it

- At first start the software will create de dummy DB
- Main screens shows one button
- Press this button
- The customers screen shows a dropdown list to select a customer. (Via the dropdown box there will be no error)
- When the checkbox is checked one can add a single customer via autocompleteedittext. (Via this data input methode an error as described can occure.)
If you hear one 'click' it's OK and no error will occure. If you hear two 'clicks' the program will crash.
Sometimes I have to repeat it for 20 times before it crashes.
It also helps when you do a kind of very fast 'double click'

My equipment: Tablet 7 inch, 1GBRam, ARMv7 processor
Android 4.0.3

Thanks in advance for your support
 

Attachments

  • Test.zip
    31.7 KB · Views: 206
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
@agraham,

I removed the three DoEvents in the FillTab sub.
So far so good!. I could not repeat the error!
:sign0188:

Thank you so much.

Henk.

...where would I be without this forum...
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
@Erel

I really hoped that version 1.92 would solve the DoEvents problems as described above but it doesn´t.
Leaving out the DoEvents avoid my program from crashing but no ProgressDialog pops up without DoEvents.
If you can find time, can you please check the test.b4a file and see if you get the same error?
I am using a tablet with Android 4.0.3

Thanks in advance

Henk
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi Erel,

I get the error when using the sub ´adtCustomer_ItemClick´
The DoEvents which causes the error are in the sub `FillTab` after the ProgressDialogShow command

B4X:
Sub adtCustomer_ItemClick (Value As String)
   TabViewCreated = False
   SelectedCustomer = adtCustomer.Text
   FillTab
End Sub

B4X:
Sub FillTab
   ProgressDialogShow(Main.WaitText)
   For i = 1 To 3
      DoEvents
   Next
   lblOverview.Text = "Overview per Customer (" & SelectedCustomer & ")"
   ClearAll
   CreateScrollView
   CreateTotalView
   CreateMaterialView
   If SelectedFY >= DateTime.GetYear(DateTime.Now) Then
      CreateInOrderView
   End If
   TabViewCreated = True
   tbhSub2.CurrentTab = NumberOfScv
   If CheckBox1.Checked = True Then
      adtCustomer.Text = ""
   End If
   ProgressDialogHide
End Sub

Regards

Henk
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi Erel,

1) Check the checkbox
2) Touch AutoCompleteEditText
3) Enter the letters "Customer"
4) Select a customer -> Try to make a double click -> if you hear two clicks the program will crash

Henk
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi,

It´s 1.91.
I agree with you that it is not let say optimal but I am not sure that that is the reason.
Anyhow I like to thank you for your time.

I will try to make a small video which I will send to you so that you can see what I mean.

Henk
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi

As discussed I just send Erel the video with the crash.

If anyone else like to test then I would appreciate it as well.
I know the layout of the code is not very good but I want to understand why it crashes.
See #13 how you can reproduce the crash.

(Test2 creates a larger database which makes it easier to reproduce the error)

Henk
 

Attachments

  • Test2.zip
    24.8 KB · Views: 191
Last edited:
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi Erel,

I installed V2.00 and indeed I can't reproduce the error anymore.
Thanks you very much.:sign0098:

Henk
 
Upvote 0
Top