HI Guys
As you all know I'm a complete newbie in the Android/B4A Environment
Although I've done a few interesting and complicated Apps, I just want to know if my approach is correct, or Completely wrong.
This is how I open/close all my Panels/Activities
Is this the correct way of doing it? , or how do your Guru's do this?
Any helpful links/advice would be appreciated.
Thanks, Appreciate
Danie
As you all know I'm a complete newbie in the Android/B4A Environment
Although I've done a few interesting and complicated Apps, I just want to know if my approach is correct, or Completely wrong.
This is how I open/close all my Panels/Activities
B4X:
Sub Globals
Dim p1, p2 As Panel
' *** Main Activity
Dim MainActivity_CloseBtn_click as Button
Dim Panel1_OpenBtn_click as Button
Dim Panel2_OpenBtn_click as Button
' *** Panel 1
Dim panel1_CloseBtn_click as Button
' *** Panel2
Dim panel2_CloseBtn_click as Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
p1.Initialize("")
p1.LoadLayout("Panel1")
Activity.AddView(p1,0,0,100%x,100%y)
p1.Visible=False
p2.Initialize("")
p2.LoadLayout("Panel2")
Activity.AddView(p1,0,0,100%x,100%y)
p2.Visible=False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'*** Main Activity Panel
Sub Panel1_OpenBtn_click
p1.visible=True
End
Sub Panel2_OpenBtn_click
p2.visible=True
End
Sub MainActivity_CloseBtn_click
Activity.Finish
End Sub
'*** Panel 1 Activities
Sub panel1_CloseBtn_click
p1.visible=False
End Sub
'*** Panel 2 Activities
Sub panel2_CloseBtn_click
p2.visible=False
End Sub
Is this the correct way of doing it? , or how do your Guru's do this?
Any helpful links/advice would be appreciated.
Thanks, Appreciate
Danie