Android Question Change orientation makes B4Xpages go back to first page

asales

Expert
Licensed User
Longtime User
There are an old thread where the soluction is: change orientation to portrait.

Now the Play Console shows a warning about change the orientation to unspecified to use with Android 16 (there is will be mandatory in 2026 to foldable devices and tablets).

I want to start to change my apps (that is all using the portrait orientation) to unspecified, but I get this behavior: always back to the first page and this info in the logs:
#SupportedOrientations attribute must be set to landscape or portrait.

With this line in the manifest, I can solved half of the problem (don't back to first page):
B4X:
SetActivityAttribute(Main, "android:configChanges", "orientation|layoutDirection")
but when I change the orientation, the layout don't adjust in the scren

Any tip to solved it?

Thanks in advance.
 

aeric

Expert
Licensed User
Longtime User
I never tried to change orientation since using B4XPages.
Since you said it reverts back to first page, how about assigning a public variable to store the name of page when loading each page and reload the page base on the variable when the screen orientation changed.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Any tip to solved it?
One limitation of B4XPages is that you are bound to ONE Orientation and it can not be changed.

 
Upvote 0

asales

Expert
Licensed User
Longtime User
Thanks both for the answers.

I'll wait for an answer from @Erel too about this feature, because the orientation = unspecified will be mandatory in a near future.

To me - that has dozen of apps in the Play Store - will better to start to implement this modifications, because is a huge work to adapt some apps to fit in both sizes.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'll wait for an answer from @Erel too about this feature, because the orientation = unspecified will be mandatory in a near future.
For now - B4XPages projects must be locked to a specific orientation. It will be changed in the future.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…