Android Question B4XPages, Private / Public B4XPages variable, what's the different?

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

Ran this example

There are codes on B4XMainPage
B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
    Public txtUser As B4XFloatTextField
    Private btnLogin As B4XView
    Public Page2 As B4XPage2
    Public Page3 As B4XPage3
End Sub

Variables Page2 & Page3, why they are need to be public?

I think public or private doesn't matter in this case, cause with the new method B4XPages.GetPage(Id), Page2/Page3 can be accessed from any sub or class. RIght?
 

incendio

Well-Known Member
Licensed User
Longtime User
Kind of redundant, don't you think?

I will use the old method then, B4XPages.MainPage.Page2.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I just feel strange about this method : B4XPages.GetPage.

If there is other way to get the same result, why should create other method, but, you are the creator, you can do whatever you want.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Who said that we want to add the pages variables to the main page at all? There are many ways that the pages can be created.
Maybe we want to access 'page 9' from 'page 8'. Why should page 9 be declared in main page for this? Better design to get page 9 using GetPage.

I'll stop here.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Don't get wrong. I didn't mean to judge you.

I really appreciate your work here to keep upgrade B4X products even it is free.
 
Upvote 0
Top