Set orientation to landscape in android on both sides [duplicate] - android

This question already has answers here:
How can I rotate display only in landscape mode in android?
(4 answers)
Closed 6 months ago.
I am working in an android application in 2.2 and I want to set my application in landscape mode.
For that I added in my manifest with every activity tag android:screenOrientation="landscape" and it worked fine.
But it comes only in one side. If I turn the device again upside down it fit in the same position in landscape mode. How can I have landscape mode in both the side of the device. Please help me.
Thanks in advance.

Try this
android:screenOrientation="reverseLandscape"

To get an Android application to display in landscape mode only, add this line to your Activity definition in the AndroidManifest.xml file:
android:screenOrientation="landscape"
For example, 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>

Using this, I think it will help you
addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange);
function onOrientationChange(event:StageOrientationEvent):void {
trace("onOrientationChange:"+event.afterOrientation);
...and process result.
}
}

Related

Stop App Screen Rotate to the Side

My app stops from working for some reason when the phone is rotated to the side and so the app does too. How can I avoid this, making it so it appears only vertically? Thanks a lot
add this to your activities in android manifest :)
android:screenOrientation = "portrait">
Here is a full example:
<activity
android:name=".Activity.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
In your app's manifest file, set activity to be vertical... Its easy...

how to force an Android app into landscape only or portrait only? [duplicate]

This question already has answers here:
Lock screen orientation (Android) [duplicate]
(3 answers)
Closed 8 years ago.
how to force an app into landscape only or portrait only? I want to app locked into the orientation of user choices.
Thanks a lot for sharing!!
<activity android:name="Intro"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.gmaninc.package.INTRO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
one of the following in each activity in the manifest
android:screenOrientation="portrait"
android:screenOrientation="landscape"
Follow below steps to achieve what you wanted to do..
Open Android Manifest file.
Set Orientation to Portrait or Landscape
that's it..

Orientation Changes distorted the View in Android device

My app is done in Titanium. I am struggling with a issue which is that when I= launch the App by keeping the device in landscape mode. Then while loading Splash screen it first goest in Landscape mode and when app finally launches Whole UI got distorted by that orientation change. I have added the below line of code in TiApp.xml
<application android:screenOrientation="portrait" android:configChanges="keyboardHidden"/>
even though its rotating. I want to stop the orientation change of that splash screen while launching. Any idea?
In each activity you have to write
<activity android:name=".MainActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="landscape" />
Hope it help!!
Try this. Add you custom androidManifest.xml For custom xml
and add this line in androidManifest.xml and run I think this is very useful for you.
<activity android:configChanges="keyboardHidden" android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
<activity android:configChanges="keyboardHidden" android:name="ti.modules.titanium.ui.TiTabActivity" android:screenOrientation="portrait"/>
Cheers

How can we set in application run only vertically not horizontally? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
I want my android application to be only run in portrait mode?
I want to set the database for run only vertically not in horizontally so what changes in application ?
You can specify in your activity in manifest.xml how you want it to work
e.g
<activity
android:screenOrientation="landscape"> //for landscape ie horizontal
and
<activity
android:screenOrientation="portrait"> //for portrait ie vertical
If you want to make your application in force portrait mode you can to do by adding this in the manifest file :
<activity android:name=".activityName" android:screenOrientation="portrait" />
Your question is too vague.
To use your application only vertically (portrait) mode, then following changes you have to do in manifest file
<activity android:name=".YourActivity" android:screenOrientation="portrait">
This will allow your activity to run in vertical mode (portrait mode) only and its activity configuration will not be changed even if you change device orientation.
You do this in the AndroidManifest.xml file on the activity. Take a look at the Activity element documentation.
<activity android:name=".MyCustomActivity"
android:screenOrientation="portrait"
[...]
Programmatically you can do this in your activity as follows:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);

Play Video view in full screen mode [duplicate]

This question already has answers here:
playback video full screen
(5 answers)
Closed 8 years ago.
In Landscape mode video view is covering 3/4 part of screen . how to make it full screen?
Thanks
If you want to play video in full screen, then just add these changes in your Androidmanifest.xml file. Just add these two lines in android manifest file:
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|screenSize"
Like in my androidmanifest.xml file i have added it
<activity
android:name="com.appliconic.straminglivevideo.MainActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|screenSize"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Categories

Resources