I've been plagued with this problem ever since I started working with B4A. I've just let it slide for so long but I'd like to figure out what is wrong and how to fix it.
I have about 10 activities in total. Let's say I "hop" from activities 1-4 as such:
1: My main/login screen
2. A "mode" selection screen (there are 2 modes to choose from)
3. An activity for the selected mode (a different activity according to which mode was chosen)
4. A "chat" activity that loads different data according to what was selected in activity 3.
If I hit the back key quickly as activity 4 is popping into view, activity 4 exits and I am taken back to activity 3 as expected, however activity 4 "pops" back into view, then back out to 3. Sometimes it repeatedly does this a few times, and sometimes it'll just sit there indefinitely switching between activity 3 and 4. My pause event for activity 4 is nothing but switching a boolean to false, and its resume just initializes a timer and switches that boolean to true.
It doesn't happen very often if I let activity 4 load entirely and then hit back; it happens more frequently if I tap the back key just as activity 4 is coming into view. I've tried inserting DoEvents into both activity's resume/pause events in all combinations I can think of but can't get this to stop behaving this way.
I have about 10 activities in total. Let's say I "hop" from activities 1-4 as such:
1: My main/login screen
2. A "mode" selection screen (there are 2 modes to choose from)
3. An activity for the selected mode (a different activity according to which mode was chosen)
4. A "chat" activity that loads different data according to what was selected in activity 3.
If I hit the back key quickly as activity 4 is popping into view, activity 4 exits and I am taken back to activity 3 as expected, however activity 4 "pops" back into view, then back out to 3. Sometimes it repeatedly does this a few times, and sometimes it'll just sit there indefinitely switching between activity 3 and 4. My pause event for activity 4 is nothing but switching a boolean to false, and its resume just initializes a timer and switches that boolean to true.
It doesn't happen very often if I let activity 4 load entirely and then hit back; it happens more frequently if I tap the back key just as activity 4 is coming into view. I've tried inserting DoEvents into both activity's resume/pause events in all combinations I can think of but can't get this to stop behaving this way.