N Nicolás Cieri Active Member Licensed User Jul 20, 2020 #1 Hello, I want to be able to run the code of my B4X Page, when my service starts after restarting the phone. Maybe something like ... B4X: Sub Service_Create Dim p As B4XMainPage = B4XPages.GetPage("MainPage") If p.IsInitialized=False Then Dim pm As B4XPagesManager ... End If End Sub Some idea? Thanks.
Hello, I want to be able to run the code of my B4X Page, when my service starts after restarting the phone. Maybe something like ... B4X: Sub Service_Create Dim p As B4XMainPage = B4XPages.GetPage("MainPage") If p.IsInitialized=False Then Dim pm As B4XPagesManager ... End If End Sub Some idea? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2020 #2 (Use B4XPages.MainPage instead of B4XPages.GetPage("MainPage")) The B4XPages will only be created when the main activity is created. Anything that you want to do in the background should be implemented in a different class or in that service. Upvote 0
(Use B4XPages.MainPage instead of B4XPages.GetPage("MainPage")) The B4XPages will only be created when the main activity is created. Anything that you want to do in the background should be implemented in a different class or in that service.