F Facilauto Juan Member Licensed User Longtime User Feb 5, 2014 #1 Hello there! I have an application running in the device. If I press home key and then return to the app by pressing the multitask button, the app keeps running where I left it. But, if I press home key and then I press the app icon the app restarts, even entering in main_activity_create. What's happening? How can I avoid this restarting? Thanks for the answers and your time.
Hello there! I have an application running in the device. If I press home key and then return to the app by pressing the multitask button, the app keeps running where I left it. But, if I press home key and then I press the app icon the app restarts, even entering in main_activity_create. What's happening? How can I avoid this restarting? Thanks for the answers and your time.
D ducphu Active Member Licensed User Longtime User May 24, 2014 #21 Hi all, just manage to find this topic. I'm having the same issue. I thought my app has problem but I try using "Two activities" app in the tutorial. It also has same issue. So what is the conclusion? Many app, especially games, when you are playing.If you press HOME key and re-run the app again by clicking the icon, it still shows the game you were playing, not restart everything, how do they do it? Upvote 0
Hi all, just manage to find this topic. I'm having the same issue. I thought my app has problem but I try using "Two activities" app in the tutorial. It also has same issue. So what is the conclusion? Many app, especially games, when you are playing.If you press HOME key and re-run the app again by clicking the icon, it still shows the game you were playing, not restart everything, how do they do it?
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #22 If the process is still running then it should return to the last activity. Upvote 0
Arf Well-Known Member Licensed User Longtime User Mar 29, 2017 #23 I've been having a similar problem, I tried Avansys's solution: Code: Copy Sub Activity_Create(FirstTime As Boolean) If FirstTime = False Then Activity.Finish Else do something.... End If End Sub But what I'm finding is that after I actually close my app with the back button Code: Copy Sub Activity_Pause (UserClosed As Boolean) If UserClosed = True Then CallSub2(Unit_Comms, "KillUnit", "Main") Awake.ReleaseKeepAlive End If End Sub And try start the app from the icon again, it closes right away - FirstTime = False is being reported in the log window. Is this because my service is still running? Upvote 0
I've been having a similar problem, I tried Avansys's solution: Code: Copy Sub Activity_Create(FirstTime As Boolean) If FirstTime = False Then Activity.Finish Else do something.... End If End Sub But what I'm finding is that after I actually close my app with the back button Code: Copy Sub Activity_Pause (UserClosed As Boolean) If UserClosed = True Then CallSub2(Unit_Comms, "KillUnit", "Main") Awake.ReleaseKeepAlive End If End Sub And try start the app from the icon again, it closes right away - FirstTime = False is being reported in the log window. Is this because my service is still running?
Arf Well-Known Member Licensed User Longtime User Mar 29, 2017 #24 Update. I added an ExitApplication to the main's Pause fuction, and now all appears to be working OK. On droid 6.0.1. Off to test on 5 and 4.4 now. This seems to be the only way I can get it to work, is it OK to use ExitApplication? Code: Copy Sub Activity_Pause (UserClosed As Boolean) If UserClosed = True Then CallSub2(Unit_Comms, "KillUnit", "Main") Awake.ReleaseKeepAlive ExitApplication End If End Sub Upvote 0
Update. I added an ExitApplication to the main's Pause fuction, and now all appears to be working OK. On droid 6.0.1. Off to test on 5 and 4.4 now. This seems to be the only way I can get it to work, is it OK to use ExitApplication? Code: Copy Sub Activity_Pause (UserClosed As Boolean) If UserClosed = True Then CallSub2(Unit_Comms, "KillUnit", "Main") Awake.ReleaseKeepAlive ExitApplication End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Mar 29, 2017 #25 Please start a new thread for this question. Upvote 0