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 .

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 !!!
 
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
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
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
Back
Top