Hello,
I initialize my app as code shown below. Everything works fine but i am curious if it's the correct way.
Thank you.
I initialize my app as code shown below. Everything works fine but i am curious if it's the correct way.
B4X:
Public Sub Initialize
B4XPages.GetManager.LogEvents = True
B4XPages.GetManager.TransitionAnimationDuration = 0
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
registerPage.Initialize
B4XPages.AddPage("registerPage",registerPage)
restorePasswordPage.Initialize
B4XPages.AddPage("restorePasswordPage",restorePasswordPage)
loginPage.Initialize
B4XPages.AddPage("login",loginPage)
likesPage.Initialize
B4XPages.AddPage("likesPage", likesPage)
fullProfilePage.Initialize
B4XPages.AddPage("fullProfilePage", fullProfilePage)
viewLogPage.Initialize
B4XPages.AddPage("viewLogPage", viewLogPage)
prsPage.Initialize
B4XPages.AddPage("prsPage", prsPage)
friendsPage.Initialize
B4XPages.AddPage("friendsPage", friendsPage)
benchmarksPage.Initialize
B4XPages.AddPage("benchmarksPage", benchmarksPage)
calculatorPage.Initialize
B4XPages.AddPage("calculatorPage", calculatorPage)
checkinPage.Initialize
B4XPages.AddPage("checkinPage", checkinPage)
settingsPage.Initialize
B4XPages.AddPage("settingsPage", settingsPage)
updatePasswordPage.Initialize
B4XPages.AddPage("updatePasswordPage", updatePasswordPage)
newPasswordPage.Initialize
B4XPages.AddPage("newPasswordPage",newPasswordPage)
chatPage.Initialize
B4XPages.AddPage("chatPage",chatPage)
userChatPage.Initialize
B4XPages.AddPage("userChatPage",userChatPage)
wsh.Initialize(Me, "wsh")
End Sub
Private Sub B4XPage_Appear
If Root.NumberOfViews=0 Then
If Starter.KVS.GetDefault("id_user","")<>"" Then
If wsh.ws.Connected = False Then wsh.Connect(appointmentSocket)
selectUserMe(Starter.KVS.Get("id_user")) 'Getting user data and loading main layout and loading other staff
Else
B4XPages.ShowPageAndRemovePreviousPages("login") 'If no user is logged in, then remove b4xmain and show login page
End If
Else
If wsh.ws.Connected = False Then wsh.Connect(appointmentSocket)
End If
End Sub
Thank you.
Last edited: