Android Question #SupportedOrientations

IanMc

Well-Known Member
Licensed User
Longtime User
When I set it to Portrait it works great but I'd like it to change to right way up when I turn the device 180degrees.

I have an ebook reader called moonreader which does this so I know its possible.

Is there a way to do it in B4a?
 
Sounds good, I'll give it a try thanks!

Yep works!

How cool, NJ nails it again.

B4a is so cool!

btw... any idea what it does in those rare cases? does it still lock to portrait?
 
Last edited:
Upvote 0
Thank you person with unpronounceable name :)

but as NJ advised, in the project I did this:

Code: Copy
#Region  Project Attributes
    #ApplicationLabel: Android Looper
    #VersionCode: 1
    #VersionName: 1
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: sensorPortrait
    #CanInstallToExternalStorage: False
#End Region

used the sensorPortrait attribute and it works a charm.
 
Upvote 0
I think that sensorportrait dont works in phones (avoiding invert mic and speaker). So i use .setscreenorientation(9).
 
Upvote 0
Ah! I'll just try it on my phone... stand by...

It works on my phone but my phone is a bit of a special one.

I hope that if it doesn't work on some devices then it just locks it to portrait even if its upside down when you turn it 180degrees.
 
Upvote 0
In devices that not rotate upside down i can turn screen with that comnand.
 
Upvote 0
Cool and thank you

I'll try it like this then if I encounter problems I'll re-visit it.
 
Upvote 0
Back
Top