Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Wait For (ShowSplashScreen) Complete (Unused As Boolean)
Root.LoadLayout("home")
B4XPages.SetTitle(Me, "Home - " & Application.LabelName)
toast.Initialize(Root)
'AppGlobals is a class when I put all shared subs and consts
B4XLoadingIndicator1.Show
Wait For (AppGlobals.GetSubCatsNIDs (AppGlobals.SUBCATS1_TEST_ID, AppGlobals.user, AppGlobals.psw)) Complete (SubCatsNIDs1 As List)
If SubCatsNIDs1.Size = 0 Then ---> no data from server
'--> Here I should alert the user (ex. a toast message) and stop the execution of the remaining code
End If
'Remaining code
Wait For (AppGlobals.GetSubCatsNIDs (AppGlobals.SUBCATS2_TEST_ID....
Wait For (AppGlobals.GetSubCatsNIDs (AppGlobals.SUBCATS3_TEST_ID....
B4XLoadingIndicator1.hide
End sub