You can change it programmatically from an Activity with Phone.SetScreenOrientation.
You can globally disable the auto rotate feature with this code:
Manifest editor:
B4X:
AddPermission(android.permission.WRITE_SETTINGS)
B4X:
Sub AutoRotateEnabled(Enabled As Boolean)
Dim context As JavaObject
context.InitializeContext
Dim value As Int
Dim jo As JavaObject
If Enabled Then value = 1 Else value = 0
jo.InitializeStatic("android.provider.Settings.System").RunMethod("putInt", Array(context.RunMethod("getContentResolver", Null), _
"accelerometer_rotation", value))
End Sub
Thank you, Erel. And for those who need to check the current state:
B4X:
Sub GetAutoRotate As Boolean
Dim context As JavaObject
context.InitializeContext
Dim jo As JavaObject
Dim value As Int = jo.InitializeStatic("android.provider.Settings.System") _
.RunMethod("getInt", Array As Object(context.RunMethod("getContentResolver", Null) _
, "accelerometer_rotation"))
Return (value=1)
End Sub