completly closing an Activity Layout

legendofjon

Member
Licensed User
Longtime User
Hi,

I am having a minor issue here. Initially i have an activity layout open as the user enter the program for the first time, but then when they click on play game, i call upon another activity layout (the level). The issue here is that while the level layout does load, the buttons and labels from the initial layout remains. It feels like when they click on play game the new layout overlaps with the previous one (menu).

If clarifications are needed, let me know
 

klaus

Expert
Licensed User
Longtime User
When you load a new layout the previous one still remains !
You can either:
1) remove all Views from the Activity in a loop
B4X:
For i = Activity.NumberOfViews -1 To 0 Step -1
    Activity.RemoveViewAt(i)
Next
2) start a new activity

Best regards.
 
Upvote 0

legendofjon

Member
Licensed User
Longtime User
When you load a new layout the previous one still remains !
You can either:
1) remove all Views from the Activity in a loop
B4X:
For i = Activity.NumberOfViews -1 To 0 Step -1
    Activity.RemoveViewAt(i)
Next
2) start a new activity

Best regards.

Awesome!
Thanks man. Now just trying to understand your code, just what does -1 To 0 Step -1 suppose to do and is next optional

thanks
 
Upvote 0
Top