My program has multiple pages and is managed through B4XPages. When I use (dd. GetViewByName (p, "Label1") Text="Name") Modify the text prompt java. lang. TimeException: Object should be initialized first (B4XView). I have added DDD.CollectViewsDat in the mini script.
The following patterns occur on pages with errors
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
lab_loading.Left=Root.Width/2-lab_loading.Width/2
lab_loading.Top=Root.Height/3
CLASS1.Initialize
B4XPages.GetManager.TransitionAnimationDuration = 0
PLAYER_PAGE.Initialize
B4XPages.AddPageAndCreate("PLAYER", PLAYER_PAGE)
SETTING_PAGE.Initialize
B4XPages.AddPageAndCreate("SETTING", SETTING_PAGE)
GUI_PAGE.Initialize
B4XPages.AddPageAndCreate("GUI", GUI_PAGE)
B4XPages.ShowPage("MainPage")
End Sub
When I first initialize PLAYER-PAGE, then initialize SETTING-PAGE. At this point, modifying tag text on the PLAYER-PAGE page will result in an error, while SETTING-PAGE will not. If SETTING-PAGE is initialized first and then PLAYER-PAGE is initialized, the problem will occur on the SETTING-PAGE page