Android Question Call PageCreated

dannyjon

Member
Licensed User
Longtime User
In my code, PageCreated calls a Sub. If I navigate away from the page and go back, PageCreated does not fire and the sub does not get called.
I know pages can not be destroyed with B4X which gives a smooth UI but how can I call a method? Initialize will not allow it to be called there.
I tried to initialize the page in the method that calls this page to load but it made no difference. I think I must have missed a very simple thing here. Thank you!
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("drawinglist")
    CLV1.Clear
    MsgboxAsync("page created object fired","")
    GetLocalDWG  '<<<<<<<This needs to fire each time the page is accessed'
 

DonManfred

Expert
Licensed User
Longtime User
Create a sub to call GetLocalDWG in there or move the loading to the correct event.
See the available Events for B4XPages.

Page created is called once.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I must have missed a very simple thing here
Maybe something like this:
B4X:
Sub B4XPage_Appear
    GetLocalDWG  '<<<<<<<This needs to fire each time the page is accessed'
End Sub
You take GetLocalDWG off the B4XPage_Created. Now, my knowledge of B4XPages is still shaky, but I have seen similar questions before, so I thought I take a stab at it.
 
Upvote 0
Top