A Arturs Member Licensed User Longtime User Nov 6, 2015 #1 Hi I have aplication with three activities. After Pausing my aplication should start working from MainActivity (always) independent on which activity worked before Pausing How to do it ? Regards Artur
Hi I have aplication with three activities. After Pausing my aplication should start working from MainActivity (always) independent on which activity worked before Pausing How to do it ? Regards Artur
R Roycefer Well-Known Member Licensed User Longtime User Nov 6, 2015 #2 Are you using the StarterService? Upvote 0
R Roycefer Well-Known Member Licensed User Longtime User Nov 6, 2015 #4 That's probably the way to go. Here's a good place to start reading about it: https://www.b4x.com/android/forum/t...-consistent-single-entry-point.57599/#content Upvote 0
That's probably the way to go. Here's a good place to start reading about it: https://www.b4x.com/android/forum/t...-consistent-single-entry-point.57599/#content
A Arturs Member Licensed User Longtime User Nov 6, 2015 #5 Sorry, I misunderstood you. Of course I use StarterService but I did not know that it is the same as Service Module. I use it in foreground mode so it is running all the time. I can call from current activity in the place Code: Sub Activity_Pause (UserClosed As Boolean) End Sub a SUB from Service Module and do something but how to detect that currently activity was unpaused and switch my aplication to Main Activity Upvote 0
Sorry, I misunderstood you. Of course I use StarterService but I did not know that it is the same as Service Module. I use it in foreground mode so it is running all the time. I can call from current activity in the place Code: Sub Activity_Pause (UserClosed As Boolean) End Sub a SUB from Service Module and do something but how to detect that currently activity was unpaused and switch my aplication to Main Activity
JonPM Well-Known Member Licensed User Longtime User Nov 6, 2015 #6 Does the user need to be able to navigate back and forth between the other 2 activities? If not perhaps you can just call Activity.Finish in both of those Activity_Pause routines? Upvote 0
Does the user need to be able to navigate back and forth between the other 2 activities? If not perhaps you can just call Activity.Finish in both of those Activity_Pause routines?
cimperia Active Member Licensed User Longtime User Nov 6, 2015 #7 Why not use a Process Global variable, and check its value? Code: 'Main activity Sub Process_Globals Dim HasAnyActivityPaused As Boolean = False End Sub You would set it to True in all other activities whenever they pause. Code: Sub Activity_Pause (UserClosed As Boolean) HasAnyActivityPaused = True End Sub Now you check that flag in the Activity_Create or Activity_Resume sub (whatever is best for your app). And if it's set to True, you finish the current activity and return to Main, where you reset the boolean flag to False. Upvote 0
Why not use a Process Global variable, and check its value? Code: 'Main activity Sub Process_Globals Dim HasAnyActivityPaused As Boolean = False End Sub You would set it to True in all other activities whenever they pause. Code: Sub Activity_Pause (UserClosed As Boolean) HasAnyActivityPaused = True End Sub Now you check that flag in the Activity_Create or Activity_Resume sub (whatever is best for your app). And if it's set to True, you finish the current activity and return to Main, where you reset the boolean flag to False.