Android Question B4XPage and Main activity

Dey

Active Member
Licensed User
Longtime User
Hello to all
I am converting an android app from activity to B4XPage
in the main main module I load a layout with a width like the screen and a height of 25dip, I use it as a bar with functions for all the B4XPages, these are lower than 25dip so as to never cover the main bar.
It seems to be working correctly,
I have seen in other threads that it is discouraged, NEVER ADD CODE TO THE MAIN ACTIVITY. https://www.b4x.com/android/forum/threads/b4xpages-activity_create.135268/#post-855637
What can cause this solution?
Thank you
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
"Never" is a bit of an exaggeration. I do see many cases where developers misuse B4XPages and add unnecessary code to the main module.

If you are building a non-cross platform solution then adding layout, as you wrote, sounds valid.
I would have done it differently and implement the bar in a class, and create a class instance in each of the pages. This will be cross platform, and in the long run, will also be easier to maintain.
 
Upvote 0

Dey

Active Member
Licensed User
Longtime User
Thanks for the prompt reply,
the previous solution used this system with a class, when I switched to another activity I noticed a flickering not nice
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…