C Creideiki Active Member Licensed User Longtime User Jan 4, 2023 #1 Hi all, I'm a bit confused. I have Activities like this: Code: Copy Sub Process_Globals Type testType (a as String, b as Int) End Sub ... Code: Copy Sub Process_Globals dim tt as testType End Sub Sub Activity_Create(FirstTime as Boolean) tt.Initialize End Sub ... When I log tt.IsInitialized here, it is true as expected. Now I have a class which uses Activity1.tt. That works, I can access the correct values, but Activity1.tt.IsInitialized gives me 'false'. It is definitly called after Activity1 is created (I ensured my with logging anything). I tried to create a simple app which could show this behaviour, but there it works. * Has anyone an idea what could happen here? * Is there anything that coud go wrong if I didn't test if tt is initialized (I only use simple types in that custom type)?
Hi all, I'm a bit confused. I have Activities like this: Code: Copy Sub Process_Globals Type testType (a as String, b as Int) End Sub ... Code: Copy Sub Process_Globals dim tt as testType End Sub Sub Activity_Create(FirstTime as Boolean) tt.Initialize End Sub ... When I log tt.IsInitialized here, it is true as expected. Now I have a class which uses Activity1.tt. That works, I can access the correct values, but Activity1.tt.IsInitialized gives me 'false'. It is definitly called after Activity1 is created (I ensured my with logging anything). I tried to create a simple app which could show this behaviour, but there it works. * Has anyone an idea what could happen here? * Is there anything that coud go wrong if I didn't test if tt is initialized (I only use simple types in that custom type)?
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2023 #2 Truth is that dealing with the activities life cycle is a complete waste of time. Switch to B4XPages and forget from all these nuances. Last edited: Jan 5, 2023 Upvote 0
Truth is that dealing with the activities life cycle is a complete waste of time. Switch to B4XPages and forget from all these nuances.
C Creideiki Active Member Licensed User Longtime User Jan 5, 2023 #3 Well, I know, Erel... but for a project with a dozen of activities and many other classes it would imply a complete rewrite. And my customer wouldn't pay for that. Upvote 0
Well, I know, Erel... but for a project with a dozen of activities and many other classes it would imply a complete rewrite. And my customer wouldn't pay for that.