Android Question Main Settings

kosay

Member
Licensed User
Longtime User
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 .

B4X:
StartActivity("settings1")

Then user must click next to show settings2 layout .

B4X:
StartActivity("settings2")

then user show main layout .
Now I try to end program by this code :

B4X:
Activity.Finish

but when I try it , the program go to settings2 layout , and not end application !!!
 

sorex

Expert
Licensed User
Longtime User
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

qsrtech

Active Member
Licensed User
Longtime User
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:
B4X:
Activity.Finish
StartActivity("settings2")
 
Upvote 0

kosay

Member
Licensed User
Longtime User
I used

B4X:
StartActivity("settings2")
Activity.Finish

and last layout use exitapplication
and work fine
 
Upvote 0

devlei

Active Member
Licensed User
Longtime User
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:

B4X:
Sub Activity_Pause (UserClosed As Boolean)
    If blnFinishActivity = True OR UserClosed = True Then
        Activity.Finish
    End If
End Sub
 
Upvote 0
Top