Android Question Change orientation

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello my friends,
I want to ask you if there is anyway out there to change the orientation of the screen without enable the auto-screen orientation
B4X:
    If rotate.GetAutoRotateEnabled=0 Then
    rotate.SetAutoRotateEnabled(1)
End If
Thanks in advance!
 
Last edited:

yiankos1

Well-Known Member
Licensed User
Longtime User
Thank you very much for quick reply, but i mentioned above, that i want another way than this one:
B4X:
If rotate.GetAutoRotateEnabled=0 Then
    rotate.SetAutoRotateEnabled(1)
End If
cause i don't want to enable that setting to user, if he doesen't enabled that setting by his own.
So you gonna say me, enable auto screen orientation at Activity_resume and disable it at Activity_pause but that leads to loop when rotating phone. Cause, when phone rotates, activity first pauses and then activity resumes and does not work!
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Hi @yiankos1 you have misunderstood. With the phone library you can set which ever orientation you want by code. You don't need to set the auto rotate mode at all, just leave it set to whatever the user has chosen. But if your Application requires landscape for one activity just call the setscreenorientation. See my previous link for its implementation.
 
Upvote 0
Top