Jausa Member Licensed User Longtime User Feb 19, 2015 #1 How I can close all activities that are open when my application is closed?
derez Expert Licensed User Longtime User Feb 19, 2015 #2 See Erel's answer here https://www.b4x.com/android/forum/threads/how-to-close-the-app-correctly.9650/#post-53455 Upvote 0
See Erel's answer here https://www.b4x.com/android/forum/threads/how-to-close-the-app-correctly.9650/#post-53455
Jausa Member Licensed User Longtime User Feb 19, 2015 #3 How I can close an activity from another activity? Upvote 0
DonManfred Expert Licensed User Longtime User Feb 19, 2015 #4 Jausa said: How I can close an activity from another activity? Click to expand... If activity B is runing then the only one you can finish is activity B. That´s how android works. What you can do is: Asuming you have activity MAIN and B AND C. in main when starting B B4X: StartActivity(B) in B then when starting C B4X: Activity.finish StartActivity(C) When you then finish C youll get back to MAIN; not to B cause you finished it Upvote 0
Jausa said: How I can close an activity from another activity? Click to expand... If activity B is runing then the only one you can finish is activity B. That´s how android works. What you can do is: Asuming you have activity MAIN and B AND C. in main when starting B B4X: StartActivity(B) in B then when starting C B4X: Activity.finish StartActivity(C) When you then finish C youll get back to MAIN; not to B cause you finished it
lemonisdead Well-Known Member Licensed User Longtime User Feb 19, 2015 #5 DonManfred said: in B then when starting C Click to expand... Hello, I am used to order it differently. Is it a problem ? Thanks B4X: StartActivity(C) Activity.Finish Upvote 0
DonManfred said: in B then when starting C Click to expand... Hello, I am used to order it differently. Is it a problem ? Thanks B4X: StartActivity(C) Activity.Finish
Jausa Member Licensed User Longtime User Feb 19, 2015 #6 But if I do not finish the activity B and from C back to main, how can I close it? Upvote 0
DonManfred Expert Licensed User Longtime User Feb 19, 2015 #7 lemonisdead said: Is it a problem ? Click to expand... Probably no cause BOTH commands are executed after the sub finishes. Upvote 0
lemonisdead said: Is it a problem ? Click to expand... Probably no cause BOTH commands are executed after the sub finishes.
DonManfred Expert Licensed User Longtime User Feb 19, 2015 #8 Jausa said: But if I do not finish the activity B and from C back to main, how can I close it? Click to expand... You can NOT close activity B from C! ONLY B can. Or the system when it kills your process. You can do in C B4X: activity.finish startactivity(main) But B stays till the task is killed or reopened again. Upvote 0
Jausa said: But if I do not finish the activity B and from C back to main, how can I close it? Click to expand... You can NOT close activity B from C! ONLY B can. Or the system when it kills your process. You can do in C B4X: activity.finish startactivity(main) But B stays till the task is killed or reopened again.
Jausa Member Licensed User Longtime User Feb 19, 2015 #9 If I finish an activity, global variables can then use them in another activity? Activity A Sub Process_Globals Dim Client As String End Sub Activity B a.client Upvote 0
If I finish an activity, global variables can then use them in another activity? Activity A Sub Process_Globals Dim Client As String End Sub Activity B a.client
DonManfred Expert Licensed User Longtime User Feb 19, 2015 #10 honestly i dont know. Try it! But i i should guess or give an answer i would say: Yes, as long as the process is running. Upvote 0
honestly i dont know. Try it! But i i should guess or give an answer i would say: Yes, as long as the process is running.
lemonisdead Well-Known Member Licensed User Longtime User Feb 19, 2015 #11 DonManfred said: Yes, as long as the process is running. Click to expand... +1 And if some data have to be preserved, you can use a code module and refer to it (perhaps simpler to manage in my opinion) Upvote 0
DonManfred said: Yes, as long as the process is running. Click to expand... +1 And if some data have to be preserved, you can use a code module and refer to it (perhaps simpler to manage in my opinion)