Android Question Accessing object on another B4xPage

dannyjon

Member
Licensed User
Longtime User
I am calling a page from one sub which loads ok the FIRST time.
If I call the same sub the PageCreate is obviously ignored. I need to change the color of a panel on the page that is called, so first time is ok but every call after that fails.
I have declared the panel as public is the sub I call but it fails. Page Appear event returns panel not init which is correct as it's added in the designer.

How can I access the panel object?

B4X:
'Call the page (First time all is well)
Dim fn As String = localDWG.Get(Index-1)
    ToastMessageShow("clv " & fn,True)
        B4XPages.MainPage.selectedDWG=fn

    B4XPages.ShowPageAndRemovePreviousPages("pgAddNewItem")
    B4XPages.MainPage.pgAddNew.pnlmarker.Color=Colors.Magenta'  < Ok the first time only
    
    'In page I call
    
public Sub B4XPage_Appear
    ToastMessageShow("B4XPage_Appear",True)
    pnlmarker.Color=Colors.Magenta        < !! Not initialized
End Sub'
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…