Android Question B4xPages- passing values between pages

Pepebis

Member
Licensed User
Longtime User
Dear All ,
Trying to find an easy way to pass values between pages.
Best Regards ,
Przemyslaw
 
In your passrandom example, in Sub Button1_Click at line 34, you have used the string "pageTwo", it should be "pagTwo" - you have an erroneous "e".
Debug is your friend!
At least, it runs ok for me with that correction.
 
Upvote 0
Try this:


Code: Copy
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    
    pagTwo.Initialize
    B4XPages.AddPageAndCreate("clsPagTwo", pagTwo)
End Sub

Sub passing_tolabel
    Label2.Text = pagTwo.Val

End Sub

Sub Button1_Click
    B4XPages.ShowPage("clsPagTwo")
End Sub
 
Upvote 0
There was a mistake with that pages, navigation. Agree. Changed it already ... but still, it not showing a number on a label at main page after starting the generator on page 2 . Any suggestion?
 
Upvote 0

Similar Threads

Back
Top