From following .xml file I set xml to show TabHost but after i run it on emulator it show both both orientation. i want to set it to show only one orientation. How do i do?
add this line in your manifest.xml file.
<activity android:name=".activity"
android:screenOrientation="portrait">
</activity>
if you want only landscape orientation then change to landscape
instead of portrait
In the AndroidMainfeast.xml file you will see
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.NoActionBar">
</activity>
so Add after .MainActivity
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"
android:configChanges="" help us to prevent onpause() and OnResume() method when we made rotation.
Set in this android:screenOrientation="portrait"
in your activity in manifest .