Bug? Null pointer exceptions after sleep in resumable sub

techgreyeye

Member
Licensed User
Longtime User
First spotted in B4A 12.50, still happening in 12.80.
I've tested this on a few devices with different Android versions and it crashes on all three.

If I call MsgboxAsync or Msgbox2Async after a sleep within a ResumableSub in a class module, the app crashes.
If I have a try...catch block after a sleep within a ResumableSub in a class module, the app crashes.

This can be reproduced in the attached project. Normal tap on the button to reproduce case 1, long tap to reproduce case 2.

In both cases, if there is a breakpoint within the sub, the app does no crash regardless of whether the breakpoint is hit.

Related thread with a bit more explanation here :
 

Attachments

  • AsyncCrash.zip
    9.5 KB · Views: 24

OliverA

Expert
Licensed User
Longtime User

techgreyeye

Member
Licensed User
Longtime User
This is indeed a bug.

FWIW, it doesn't happen in B4XPages. B4XPages simplifies the overly complicated activities life cycle. I recommend all new projects to be based on B4XPages.

I've only just got round to "going async" on my main android product, so I don't know when I will get around to converting it to B4XPages.
Thanks for confirmation.
 
Top