To get an Android application to display in landscape mode only (to lock it 
in landscape mode), add this line to your Activity definition in the 
AndroidManifest.xml file:

android:screenOrientation="landscape"

For example, I’m writing an Android football game right now, and this is 
the definition for my main activity in the Android manifest file:

<activity
    android:name=".MainActivity"
    *android:screenOrientation="landscape"*
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>


On Wednesday, June 17, 2020 at 7:59:39 PM UTC+5:30, Dave McLaughlin wrote:
>
> I want to set the build so that the only screen orientation available is 
> landscape.
>
> I have disabled autorotation but one app I run always changes the display 
> to portrait and this is not ideal on a landscape only display. It changes 
> back to landscape on exit but is not very user friendly from the 90 deg 
> angle. 
>
> Where in the build can I make changes that prevent any orientation changes 
> by any app?
>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-porting/83cee293-d0ff-4a19-b4c7-702edc776cfbo%40googlegroups.com.

Reply via email to