Dim a1 As Int
Private Sub Amir_onItemClick (Parent As Panel,Position As Int)
a1=Position
StartActivity(activity2)
End Sub
activity2:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layot1")
If activity1.a1=0 Then
MsgboxAsync("xxx", "info")
Else If activity1.a1=1 Then
MsgboxAsync("yyy", "info")
End If
End Sub
I want to convert my application to b4page.
what is the b4x pages equivalent of the above code.
the code below fails. it shows "xxx" continuously.
thanks..
B4xpage
activity1:
Dim a1 As Int
Private Sub Amir_onItemClick (Parent As Panel,Position As Int)
a1=Position
B4XPages.ShowPage("activity2")
End Sub
activity2:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("layot1")
If B4XPages.MainPage.activity1.a1=0 Then
MsgboxAsync("xxx", "info")
Else If B4XPages.MainPage.activity1.a1=1 Then
MsgboxAsync("yyy", "info")
End If
End sub
B4XPages.MainPage.activity1.a1=0
What is this?
It would be easier to help you, at least for me, if you posted a small project showing the problem.
Just with code snippets it is difficult to help.
B4XPages.MainPage.activity1.a1=0
What is this?
It would be easier to help you, at least for me, if you posted a small project showing the problem.
Just with code snippets it is difficult to help.
You should create the B4XPage_Appear event routine and move NetWork there.
As the comment says, B4XPage_Created is called only once when the page is created.
B4X:
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
' Network
End Sub
Private Sub B4XPage_Appear
Network
End Sub
To generate a zip file for a B4XPages project you should use this line on top of the code in B4XMainPage.
I had to comment line #2 to make the program run because of the missing Shared Files folder.