Android Question App Compat Drawer Center panel question

John Decowski

Member
Licensed User
Longtime User
Im using this tutorials code: https://www.b4x.com/android/forum/threads/b4x-b4xdrawer-sliding-drawer.97828/ I set the center panel using .loadlayout and it works but when i try to load a different layout for a different section it just overwrites on top of the screen. and I cant figure out how to clear the panel first. I know in android you should be using multiple activities but I cannot figure out how to incorporate the tool bar and left draw into multiple activities.


B4X:
        Drawer.CenterPanel.LoadLayout("TradeJournal")
thanks in advance.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

John Decowski

Member
Licensed User
Longtime User
did you used Activity.RemoveAllViews?
ok , I got it to work by activity.removeallviews but seems more of a workaround than an actual solution. As you see the code below I remove all views and then have to re run the activity create routine to redraw toolbar. If I dont re run the create routine the toolbar will be gone. Wasn't sure if there was a solution that didnt require redrawing the toolbar.

B4X:
    Activity.RemoveAllViews
    Activity_Create(False)
    Drawer.CenterPanel.LoadLayout("addjournal")

thank you for your help Don! Appreciate it!
 
Upvote 0
Top