B bocker77 Active Member Licensed User Longtime User Mar 16, 2021 #1 I am sort of sure that I am understanding when FirstTime can get set to True but then again most probably not. My program utilizes a foreground service that sends Main GPS coordinates almost continuously except when it gets throttled for a short time when Main is doing something. The service sets locks with PartialLock and KeepAlive(False) to cutdown on battery usage. In Main FirstTime I set a couple of values in an integer that forces a CustomListview to get populated. I have to drive in my car to fully test the app. Anyway I noticed that the CustomListview went blank and started to repopulate. This tells me that FirstTime ran again. My app only runs in Porttrait mode. I tried testing this out by rotating another app that is running and FirstTime code didn't run. I also received a text message when the program was running and no FirstTime then either. I am trying to understand how in what instances our boy Android would run FirstTime code again so that I can debug it. After reading Erel's post on StateManager I am thinking that this would not help me out. But then again maybe it can.
I am sort of sure that I am understanding when FirstTime can get set to True but then again most probably not. My program utilizes a foreground service that sends Main GPS coordinates almost continuously except when it gets throttled for a short time when Main is doing something. The service sets locks with PartialLock and KeepAlive(False) to cutdown on battery usage. In Main FirstTime I set a couple of values in an integer that forces a CustomListview to get populated. I have to drive in my car to fully test the app. Anyway I noticed that the CustomListview went blank and started to repopulate. This tells me that FirstTime ran again. My app only runs in Porttrait mode. I tried testing this out by rotating another app that is running and FirstTime code didn't run. I also received a text message when the program was running and no FirstTime then either. I am trying to understand how in what instances our boy Android would run FirstTime code again so that I can debug it. After reading Erel's post on StateManager I am thinking that this would not help me out. But then again maybe it can.
LucaMs Expert Licensed User Longtime User Mar 16, 2021 #2 FirstTime will only be set to False again if the Activity is destroyed. The whole discussion is not clear to me but I sense that, like everyone else, you should switch to B4XPages. Upvote 0
FirstTime will only be set to False again if the Activity is destroyed. The whole discussion is not clear to me but I sense that, like everyone else, you should switch to B4XPages.
B bocker77 Active Member Licensed User Longtime User Mar 19, 2021 #3 I will look into B4XPages and see what it will take to convert my app. From your comment it sounds like this would solve this particular issue. Thanks Lucas, Greg Upvote 0
I will look into B4XPages and see what it will take to convert my app. From your comment it sounds like this would solve this particular issue. Thanks Lucas, Greg
LucaMs Expert Licensed User Longtime User Mar 19, 2021 #4 bocker77 said: this would solve this particular issue. Click to expand... ... and many others! Upvote 0