I'm afraid that the Msgbox handling still seems to be not quite right Erel!
I bet you wish you'd never tried implementing this modal stuff in Android 
This minimal program gives a force close if the device is rotated while the message box is displayed. It happens whether the Msbox is displayed from Activity_Create as here or after it completes from, say, a button click event.
This minimal program gives a force close if the device is rotated while the message box is displayed. It happens whether the Msbox is displayed from Activity_Create as here or after it completes from, say, a button click event.
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'FirstTime - True if this is the first time this activity is created.
m = "D = " & GetDeviceLayoutValues
Msgbox(m, "layout")
End Sub