In my code, I have this loop, which runs until the user has entered his name and password:
B4X:
Do While DialogComplete = False
DoEvents
Loop
Immediately after that, I fill the menus. But I don't want that before the proper login has taken place.
Following recommendations, I replaced DoEvents by Sleep(0).
As a result, the menu loads prematurely, and more intriguing, the box of a checkbox turns green.
This is a big mistake to leave such code. The result will be hard crashes that happen sometimes on some devices.
You can create any dialog that you like with B4XDialog, especially once you learn how to work with resumable subs. Well worth watching the video tutorial: [B4X] Resumable Subs - Sleep / Wait For