kosay Member Licensed User Longtime User Jan 19, 2014 #1 Hi all , I am new with B4A , and i have some questions (it is too easy for other) . I make application with splash screen and when user click next it must show settings1 layout . Code: Copy StartActivity("settings1") Then user must click next to show settings2 layout . Code: Copy StartActivity("settings2") then user show main layout . Now I try to end program by this code : Code: Copy Activity.Finish but when I try it , the program go to settings2 layout , and not end application !!!
Hi all , I am new with B4A , and i have some questions (it is too easy for other) . I make application with splash screen and when user click next it must show settings1 layout . Code: Copy StartActivity("settings1") Then user must click next to show settings2 layout . Code: Copy StartActivity("settings2") then user show main layout . Now I try to end program by this code : Code: Copy Activity.Finish but when I try it , the program go to settings2 layout , and not end application !!!
S sorex Expert Licensed User Longtime User Jan 19, 2014 #2 when you don't have much pages to display it is easier to use different panels and show/hide them when needed. didn't use more than one activity so far myself tho. Upvote 0
when you don't have much pages to display it is easier to use different panels and show/hide them when needed. didn't use more than one activity so far myself tho.
Q qsrtech Active Member Licensed User Longtime User Jan 20, 2014 #3 ExitApplication might work better for you. I think your activity.finish in the second activity just closes the 2nd one and therefore goes back to the first one. If ExitApplication isn't right then maybe try: Code: Copy Activity.Finish StartActivity("settings2") Upvote 0
ExitApplication might work better for you. I think your activity.finish in the second activity just closes the 2nd one and therefore goes back to the first one. If ExitApplication isn't right then maybe try: Code: Copy Activity.Finish StartActivity("settings2")
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2014 #4 You should definitely not use ExitApplication. The above code will work correctly. Upvote 0
kosay Member Licensed User Longtime User Jan 20, 2014 #5 I used Code: Copy StartActivity("settings2") Activity.Finish and last layout use exitapplication and work fine Upvote 0
I used Code: Copy StartActivity("settings2") Activity.Finish and last layout use exitapplication and work fine
D devlei Active Member Licensed User Longtime User Jan 21, 2014 #6 In the button_Click procedure you use 'StartActivity', but then use Activity.Finish in the Activity Pause procedure. Doing it this way enables you to include a boolean variable (blnFinishActivity) to give you the option of whether to close the activity or not. Something like the below: Code: Copy Sub Activity_Pause (UserClosed As Boolean) If blnFinishActivity = True OR UserClosed = True Then Activity.Finish End If End Sub Upvote 0
In the button_Click procedure you use 'StartActivity', but then use Activity.Finish in the Activity Pause procedure. Doing it this way enables you to include a boolean variable (blnFinishActivity) to give you the option of whether to close the activity or not. Something like the below: Code: Copy Sub Activity_Pause (UserClosed As Boolean) If blnFinishActivity = True OR UserClosed = True Then Activity.Finish End If End Sub