Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UTILITY") 'Without this the attached works, but with this when closing the page3, page2, page1, the MainPage disappears.
'It is still there but not in focus (minimize IDE to see it)
MainForm.Show
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(MainForm)
End Sub
Apparently 1st page cannot be UTILITY. Therefore a SOLUTION:
B4X:
'remove from Main
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
' MainForm.SetFormStyle("UTILITY") 'remove here'
' MainForm.Show 'remove here'
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(MainForm)
End Sub
'And add to other page classes, except for 1st (In this example MainPage)
Private Sub B4XPage_Created (Root1 As B4XView)
B4XPages.GetNativeParent(Me).SetFormStyle("UTILITY") 'add this
Root = Root1
'load the layout to Root
End Sub