When I update the android studio 3.6 its give me a red line below android:screenOrientation="portrait".
And its say's to change to android:screenOrientation="fullSensor"
Can anyone have any idea what is the reason behind it?
When I update the android studio 3.6 its give me a red line below android:screenOrientation="portrait".
And its say's to change to android:screenOrientation="fullSensor"
Can anyone have any idea what is the reason behind it?
In Android studio 3.6.0 i guess they want the user to handle the orientation and encourage developer to use ViewModel stuff. Let me explain screenOrientation in detail
android:screenOrientation="portrait"
will give you error you have to either specify
android:screenOrientation="fullSensor" or android:screenOrientation="unspecified"
fullSensor Means either you have ON the "Rotate off" or not it will change the orientation based on you move the phone
unspecified Means if you have ON the Rotate off then it will stay only in that orientation and if not then it will change the orientation based on you move the phone.
To build on Deep Sheth's answer, this is a warning not an error.
As it suggests you set the fullSensor or unspecified in your activity so that the user can use the application in any orientation and provide a great experience in Chrome OS devices.
You can make that warning go away by adding the following to your activity declaration in the manifest: tools:ignore="LockedOrientationActivity"
I have used bellow ..
Add manifest file bellow lines ..
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="LockedOrientationActivity">
manifest file will look like..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourpackage"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="LockedOrientationActivity">
.....
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"/>
</manifest>