Android Question SupportedOrientations - can you read the definition in real time?

derez

Expert
Licensed User
Longtime User
I would like to check in a library/class if the application is defined as fixed (portrait or landscape) or unspecified, or if its rotation is prevented by the user. How can this be found by code ?
Thanks.
 

Cableguy

Expert
Licensed User
Longtime User
Hi Derez,

I just can't understand why you want to know if the user has "fixed" his device orientation...
AFAIK you either code orientation fixed apps or allow your app to adjust to an orientation change, so even if the device is in fixed portrait mode, if you have made your app landscape fixed, it will show that way, and vice-versa... so... Why the need to know is the device itself is in fixed mode?
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Why the need to know is the device itself is in fixed mode?
I am trying to improve a class, not to solve an application problem. As a class it can be used in any application.
If you have read this http://www.b4x.com/android/forum/threads/freeze-orientation.41681/ you know that there is a problem with modal dialoges when the screen is rotated. The last solution mentioned there is to inhibit the rotation and after the dialog is returned - to rotate the screen, but the value you read before is not the same as the value you use to rotate.
Since there is still a problem with this solution I prefer not to use it when the application is not free to rotate.

@Erel thanks.
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
@derez... Thanks... I was just trying to understand why.. I was not aware of the ongoing discussion...
 
Upvote 0
Top