Android Question Switching Activities

Paul Boyle

Member
Licensed User
Longtime User
Newbie here.

Just cant get the hang of these activities commands.

In VB.Net if i press a button on a form and it loads another from I can code something like

OldForm.Hide
NewForm.Load

What's the equivalent of this using activities in B4A ? For e.g.. if I have an Exit button and want to hide/close the current activity and open the main activity?

Many Thanks.
 

Mahares

Expert
Licensed User
Longtime User
Suppose your button is in the main Activity and you want to pause main and go to the second activity. If the 2nd activity is called Boyle, you do this:
B4X:
Sub MyButton_Click
      StartActivity(Boyle)
end sub
 
Upvote 0

Paul Boyle

Member
Licensed User
Longtime User
First layout loaded is:

'Load Layout
Activity.LoadLayout("lay_Home")

I hit a button on this activity, it triggers:
'Load Layout
Activity.LoadLayout("lay_Plyr")

I then hit a button (Exit_Click) and want it to close "lay_Plyr" and go back to "lay_Home". This is where its not working for me.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…