Android Question [B4XPages] Switching Phone SetScreenOrientation in B4XPages

GabrielM

Member
Licensed User
Longtime User
In a project based on B4XPages I have one page that should be presented in Landscape mode. I though I should use the SetScreenOrientation from Phone library.

What I have noticed is that when using the SetScreenOrientation to change from one orientation to another the application will be paused while generating in log the following line:
"Object context is paused. Ignoring CallSubDelayed: B4XPage_Appear" .

B4X:
' Detailed log here

' now clicked on the button btnDraw on Page 2  to show Page 3
** Activity (main) Pause event (activity is not paused). **
Page 3 disappeared
Pause generated by Orientation change ?
** Activity (main) Create, isFirst = false **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **

' now clicked on the button btnSet on Page 3  to show the Page 2
Page 3 disappeared
** Activity (main) Pause event (activity is not paused). **
Pause generated by Orientation change ?
Object context is paused. Ignoring CallSubDelayed: B4XPage_Appear
** Activity (main) Create, isFirst = false **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **

I have tried to find a workaround using a variable to check against in Activity_Resume, and can switch pages now in their respective orientation, but I still get that warning in log, mainly when going from Landscape to Portrait (probably not relevant).

The project based on the " B4XPages - 3 Page example" is attached , and the lines I have added are bookmarked.

Is there a proper solution to switch between pages orientation ?
 

Attachments

  • B4XPages_Test.zip
    16.5 KB · Views: 196

DonManfred

Expert
Licensed User
Longtime User
Is there a proper solution to switch between pages orientation ?
B4XPages are bound to ONE orientation. It can not be changed at runtime.

It does have some limitations. One notable limitation is that in B4A, the activity that holds all the pages should be locked to a single orientation.

You are free to start a new activity - not using B4XPages - in another orientation.
 
Last edited:
Upvote 0
Top