L lip Active Member Licensed User Longtime User Sep 5, 2022 #1 Context: My project has several activity modules and services. I use Starter service for all Process_Globals that are shared between Activties. I am not using Pages. The issue I am addressing is occasional lockups (Object Not Initialised) when I pick the tablet up having not touched it for a while (ie half an hour or so). I've not managed to catch it in Debug mode so don't know what is 'not initialised'. In each Activity module I declare in Globals: Code: Copy Private Dialog As B4XDialog Private XUI As XUI I initialize B4XDialog in Activity_Create Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("SplashPage") If FirstTime Then Dialog.Initialize (Activity) My question is: Should I move Dialog.Initialise (Activity) outside of the FirstTime condition?
Context: My project has several activity modules and services. I use Starter service for all Process_Globals that are shared between Activties. I am not using Pages. The issue I am addressing is occasional lockups (Object Not Initialised) when I pick the tablet up having not touched it for a while (ie half an hour or so). I've not managed to catch it in Debug mode so don't know what is 'not initialised'. In each Activity module I declare in Globals: Code: Copy Private Dialog As B4XDialog Private XUI As XUI I initialize B4XDialog in Activity_Create Code: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("SplashPage") If FirstTime Then Dialog.Initialize (Activity) My question is: Should I move Dialog.Initialise (Activity) outside of the FirstTime condition?
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2022 #2 lip said: My question is: Should I move Dialog.Initialise (Activity) outside of the FirstTime condition? Click to expand... Yes. Globals are recreated when the activity is recreated, so the FirstTime check will cause it to crash. In the long run you should switch to B4XPages. It solves all these issues and many more. Upvote 0
lip said: My question is: Should I move Dialog.Initialise (Activity) outside of the FirstTime condition? Click to expand... Yes. Globals are recreated when the activity is recreated, so the FirstTime check will cause it to crash. In the long run you should switch to B4XPages. It solves all these issues and many more.