I have been experimenting with this. The idea is that although B4XPages is committed to an orientation, this orientation can be
determined at run time, as long as the commitment occurs before B4XPagesManager is Initialized.
If a timer finds that (by using the sensors) the orientation has changed, the App can be stopped and restarted with a new orientation.
The effect is as if the app has paused and resumed. Of course the state of the App must be preserved in an external file.
I have an old Tab S2, so I am stuck with Android 7.0. Can anyone test this with a newer model? It would be nice if it works.
The following is the modified Main Module that implements this idea.
The method for sensing orientation change is extracted from @emexes:
https://www.b4x.com/android/forum/t...-with-portrait-orientation.106872/post-669094
P.S. Ignore log message about orientation.
Edit. I have removed the code that was posted here that caused errors in Android 12. See this corrected code snippet and project .zip.
https://www.b4x.com/android/forum/t...reen-orientation-while-using-b4xpages.136476/
determined at run time, as long as the commitment occurs before B4XPagesManager is Initialized.
If a timer finds that (by using the sensors) the orientation has changed, the App can be stopped and restarted with a new orientation.
The effect is as if the app has paused and resumed. Of course the state of the App must be preserved in an external file.
I have an old Tab S2, so I am stuck with Android 7.0. Can anyone test this with a newer model? It would be nice if it works.
The following is the modified Main Module that implements this idea.
The method for sensing orientation change is extracted from @emexes:
https://www.b4x.com/android/forum/t...-with-portrait-orientation.106872/post-669094
P.S. Ignore log message about orientation.
Edit. I have removed the code that was posted here that caused errors in Android 12. See this corrected code snippet and project .zip.
https://www.b4x.com/android/forum/t...reen-orientation-while-using-b4xpages.136476/
Last edited: