Thank you kindly.
I think I got this. A bit of reading on my part - especially this:
https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/
Not yet 100% sure if/how to add a panel and use it.
However, at the most base level, I have this working.
I have:
Sub Globals
Private Button1 As Button
Dim pn1 As Panel
Dim pn2 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
pn1.Initialize("")
Activity.AddView(pn1,0,0,100%x, 100%y)
pn1.LoadLayout("Form1")
pn2.Initialize("")
pn2.Visible = False
Activity.AddView(pn2,0,0,100%x,100%y)
End Sub
Now on a button, I can show the 2nd form, and hide the first:
eg:
pn2.Visible = True
pn2.LoadLayout("MyEdit")
And to close back (return to previous), then I can go:
Sub MyEditClose_Click
pn2.Visible = False
pn1.Visible = True
End Sub
Now, having this working?
Did I really have to create the first instance (panel) of pn1?
If I just go Activity.LoadLayout("Some Layout"), is this added to some base collection object? (that I can reference?).
I see lots of code - they just tend to execute a Activity.LoadLayout() and NOT create a panel var to hold that layout.
Last but not least?
I well grasp that I should use some kind of "nav panel", or whatever they are called in B4A, and this would thus reduce me the developer to hide/show forms in code, and let more of the UI do this work for me. But, baby steps - baby steps!
So, I guess my next bus stop is to try adding a panel to the designer (and adopt the "zen" of B4A, and not code such things on my own).
So, my only real question is did I have to create the first panel object (pn1) in code, or could have I just executed a Activity.LoadLayout("Form1"), and then later on referenced some built on object? Or if I need to create the first panel object in code, and THEN reference that first LoadLayout as I did.
(ie: is the only way to get a reference to the first layout I loaded is to create a panel var/object in code?
This just comes down to me grasping the B4A objectmodel.
Anyway, again, thank you. (and again - what a amazing product - only a few hours into this, and am rather enjoying this!).
Regards,
Albert Kallal
Edmonton, Alberta, Canada