Here is a simple way to change the orientation of the activity in android
Through java code we do this….


Through xml we do this

<activity android:name=”.MainActivity”
           android:screenOrientation=”landscape” >
          <action android:name=”android.intent.action.MAIN” />
          <category android:name=”android.intent.category.LAUNCHER” />

Following are two other values that you can specify in the android:screenOrientation attribute:

➤➤ portrait — Portrait mode
➤➤ sensor — Based on the accelerometer

Please leave your valuable comments.


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.