This code.
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim CVS As B4XCanvas
Dim RPane As B4XView
Dim Xui As XUI
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout...