How a activity.LoadLayout and hides

KashMalaga

Member
Licensed User
Longtime User
In other example.

a working app loads a loadlayout.

For the about form want to load another loadyout that loads fine,
but when a want to go back.
I want to destroy/hide this "info" loadlayout and show the original loadlaout.

I used some kind of methods, like views, getviews.
etc.etc
activity.SendToBack and plus more and find the correct one
 
Last edited:

KashMalaga

Member
Licensed User
Longtime User
Thanks susu for your reply.
But im talking about loadlayout. Show the main loadlayout and like about and register form show another loadlayout. This works fine. But when i want to back for the main loadlayout.
Dont know why isnt working fine.

I tried at least again loadlayout('main') but doesnt hide ALL another loadlayout. Watching some buttons and labels
 
Upvote 0

cammel8

Member
Licensed User
Longtime User

One dirty fix might be to add a sub called remove all and list every element of your project with remove tag. The idea being destroy everything and restart from scratch. Like this:

B4X:
Sub RemoveAll

button1.RemoveView
button2.RemoveView
................................
List all of your elements.RemoveView
................................
edittext1.RemoveView

End Sub

Then once you reload the loadlayout it should reinitialize everything and only put in what you want. Now I don't know for sure that this would work as I haven't tried it but I don't see why it wouldn't. I realize that it could be quite a large list depending on what all you have loaded. I think my longest removeall list was 312 lines of removeViews. but it worked for what i was trying to do.

Hope this helps.
George
 
Upvote 0

cammel8

Member
Licensed User
Longtime User

We must have been typing at the same time. But now that I see your method of removing items I am kinda pissed I never thought of removing them like that.
hehehehehehe.
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User
Sorry about that but any of two methods works fine.

In loop method, when original loadlayout is loaded doesnt load fine.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…