how to set orientation to chrome custom tab in android? - android

i have given the fix orientation to my app as a portrait.i am using chrome custom tab to open another site, however this property can not be set to chrome custom tab to remain portrait. it change its orientations.
in manifest i have set activity like
<activity
android:name=".uicontent.carrental.ZoomCarDrawerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTask"
android:noHistory="false"
android:screenOrientation="portrait"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan" />
thank you.

Related

how can I disable landscape mode javafx?

I want to disable landscape modeon javafx app for the whole app. How can I do that?
I'm also using Gluon plugin.
Thanks in advance
On Android by default you have enabled changes between portrait and landscape orientations.
If you want just portrait orientation, you can set this on the AndroidManifest.xml file under src/android/:
<activity android:name="javafxports.android.FXActivity"
android:label="<yourAppName>"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize">
...
</activity>
Add this line to your AndroidManifest.xml under the activity tag:
android:screenOrientation="portrait"

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);

Running the Android app without TitleBar

As by default, the application name is appearing on one label like TextView. How do i remove my titlebar permanently for my application?
Any ideas?
You can use below code for that -
<activity android:name="YourActivityname" android:theme="#android:style/Theme.NoTitleBar" />
If you want the full screen of your device you can use below code -
<activity android:name="YourActivityname" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
And, also refer Developer's Site
That is a setting based on the activity in your android manifest file.
Use the No Title Bar theme for your activity.
<activity android:name="MyActivityName" android:theme="#android:style/Theme.NoTitleBar" />

Lock Horizontal View

I want to lock horizontal view in my app, is it possible?
Help is highly appreciated,
Thanks,
Use android:screenOrientation="landscape" attribute for your activity.
add this code in your menifest...
<activity android:name=".activity"
android:configChanges="orientation" android:screenOrientation="portrait"></activity>
For new android Studio 3 and above
you need to put these lines in AndroidManifest.xml code if you want to set the orientation to portrait
One thing this is sensor portrait, means both upside - downside will work.
But if you only want to put portrait for upside then, replace sensorPortrait to portrait
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="sensorPortrait"
tools:ignore="LockedOrientationActivity">
Same goes for only landscape too
just one parameter change portrait to landscape
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation= "sensorLandscape"
tools:ignore="LockedOrientationActivity">

Categories

Resources