I am converting a B4PPC module to B4A. I use a single "Form" and many, many Panels all of which are created in the "App_Start" Routine. What the user looks at depends on button clicks and the view is controled by:
Although I have been using B4PPC for 10 years, this is my first foray into B4A. Considering the Android "life_cycle" I believe it would be much more efficient to break the massive "form build" cycle into individual routines (Panel with buttons, Panel with text input, etc). Where I would make the panel visible, instead create the Panel at that point and place it on the view. Where I would make it invisible, simply remove it.
Then it would not matter about initialization because all "Forms/Views" are created on demand. I should also point out that on any given day, the majority of panels would never be looked at. Is this approach better than creating all panels at app start or is their some price-to-pay in Android for re-creating views.
Thank you for your assistance.
Regards
Ed Sharp
B4X:
Panel1.Bringtofront
Panel1.Visible = True
.
.
Panel2.BringtoFront
Panel2.Visible = True
Panel1.Visible = False
Although I have been using B4PPC for 10 years, this is my first foray into B4A. Considering the Android "life_cycle" I believe it would be much more efficient to break the massive "form build" cycle into individual routines (Panel with buttons, Panel with text input, etc). Where I would make the panel visible, instead create the Panel at that point and place it on the view. Where I would make it invisible, simply remove it.
B4X:
Create_Panel("pnFront")
.
.
pnFront.Remove
Create_Pane("pnBack")
Then it would not matter about initialization because all "Forms/Views" are created on demand. I should also point out that on any given day, the majority of panels would never be looked at. Is this approach better than creating all panels at app start or is their some price-to-pay in Android for re-creating views.
Thank you for your assistance.
Regards
Ed Sharp