rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #1 I have a button that I want to press to display a new page. I have the following code to do that: Activity.LoadLayout("Setup") I created a setup.bal file in the Designer and did the layout etc. When I touch the Setup button to display this setup screen, the components display but on top of the existing screen components. I thought the switch over to the new screen would just show those components on that new screen. Do I have to destroy or kill the current layout first? Thanks...
I have a button that I want to press to display a new page. I have the following code to do that: Activity.LoadLayout("Setup") I created a setup.bal file in the Designer and did the layout etc. When I touch the Setup button to display this setup screen, the components display but on top of the existing screen components. I thought the switch over to the new screen would just show those components on that new screen. Do I have to destroy or kill the current layout first? Thanks...
JonPM Well-Known Member Licensed User Longtime User Feb 27, 2012 #2 To start another activity you need StartActivity(Setup). And in that activity you would have the Activity.LoadLayout(Setup) Upvote 0
To start another activity you need StartActivity(Setup). And in that activity you would have the Activity.LoadLayout(Setup)
A admac231 Active Member Licensed User Longtime User Feb 27, 2012 #3 When you load a new layout you are essentially just drawing the new views to the activity. If you want to have separate "screens" you should create a new activity for each layout (this keeps things much cleaner as well in my opinion). But to answer your question, Code: Copy For i = Activity.NumberOfViews - 1 To 0 Step -1 Activity.RemoveViewAt(i) Next From klaus. Also, that is the 2nd result when searching for "Activity.LoadLayout". The search function is invaluable Upvote 0
When you load a new layout you are essentially just drawing the new views to the activity. If you want to have separate "screens" you should create a new activity for each layout (this keeps things much cleaner as well in my opinion). But to answer your question, Code: Copy For i = Activity.NumberOfViews - 1 To 0 Step -1 Activity.RemoveViewAt(i) Next From klaus. Also, that is the 2nd result when searching for "Activity.LoadLayout". The search function is invaluable
rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #4 JonPM said: To start another activity you need StartActivity(Setup). And in that activity you would have the Activity.LoadLayout(Setup) Click to expand... Thanks, that makes sense. Obviously I'm new to B4A. I don't see in the IDE how to create a new Activity? I tried the File New menu but I think that created a new Project right? Upvote 0
JonPM said: To start another activity you need StartActivity(Setup). And in that activity you would have the Activity.LoadLayout(Setup) Click to expand... Thanks, that makes sense. Obviously I'm new to B4A. I don't see in the IDE how to create a new Activity? I tried the File New menu but I think that created a new Project right?
A admac231 Active Member Licensed User Longtime User Feb 27, 2012 #5 Have you had a look at the beginners guide? It is an excellent starting point. Also, to add an activity you go to Project >> Add New Module >> Activity Module Upvote 0
Have you had a look at the beginners guide? It is an excellent starting point. Also, to add an activity you go to Project >> Add New Module >> Activity Module
rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #6 Ahhh that's what I couldn't find. Project->New Module->Activity. Thanks... Upvote 0