B4J Question XUI multiple screens/activities

tsteward

Well-Known Member
Licensed User
Longtime User
Looking for some examples for cross platform B4J & B4A on how to open new activity/screen
I have searched but missing the plot.

Thank you for any guidance
 

mangojack

Well-Known Member
Licensed User
Longtime User
Unsure if there is a cross platform method .. I sure your'e aware how to start new Activity in B4A.
Are you asking how to display a new screen / form in B4J ?
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Yes my current app has many activitiesso opening and closing is fine.
I have a B4J app which also displays multiple forms.

I am looking at re-writing and statring again as I want to support all 3 B4J, B4A and B4I in the most efficient way possible and am trying to learn XUI and how do do all this. I have watch video tutorials but would love to see how people are handling this situation.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should implement everything that you can related to each screen in a class. This class will then be shared between the different platforms.

The activity module itself shouldn't be shared.

You can pass the base view to the class:
B4X:
Public Sub Initialize(Parent As B4XView)
 Parent.LoadLayout(...)
 ...
End Sub

Initialize it like this:
B4X:
Screen1.Initialize(Activity)
'or
Screen1.Initialize(Form.RootPane)
'or
Screen1.Initialize(Page1.RootPanel)
 
Upvote 0
Top