App Crash after Screen Orientation - android

I have an app with layout, layout-land, layout-sw600dp-land and layout-sw720-land.
My app works normally with bigger screen but with smaller screen phones the app will crash when I rotate the phone.
I used this code in my manifest and solve the crashing problem:
android:configChanges="orientation|screenSize"
App works fine with rotate, but its just show the layout and any land layouts will not show up.
what to do?
Thanks in advance

Related

android TV NEXBOX A95X screen orientation portrait

I want to display my screen always in portrait mode on TV(NEXBOX A95X). I have set android:screenOrientation="portrait" to Activity on Manifest file. But it is working on mobile devices but not working on TVs. It is displaying horizontally in landscape mode. Any help will be appreciated. Thanks in advance!

Samsung Tab S2 not respecting manifest screenOrientation

I have an Activity that is meant to be displayed in landscape. Ideally I want to support either direction of landscape. In my manifest I've set this on my Activity:
android:screenOrientation="sensorLandscape"
Which has worked fine in all my experience in the past. But this device seems to decide sometimes that portrait orientation is allowed. It will rotate to all 4 orientations (landscape/reverseLandscape, and portrait/reversePortrait).
If I set it like this:
android:screenOrientation="landscape"
it works correctly. Also if I disable screen rotation then it works correctly. However both of these options leave me with no reverseLandscape.
I've also tried requesting the orientation to be set in Java code:
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
This does not seem to make any difference in the behavior.
Is this a known issue on Samsung devices? and is there any workaround to get the device to respect my sensorLandscape orientation setting?

Android Layout Folder for Devices/Tablets which are always in Landscape

I'm developing an android app for phones and tablets.
I want all of the devices to use portrait layout. I made a 'layout' folder for it. But, there are some X number of devices which are always in landscape mode. Probably, large tablets. So, I made a 'layout-land' folder too.
Which folder I need to add so that X amount devices will always display landscape layout only, while other devices will always display portrait layout?
Main requirement is to have only portrait layouts displayed. But, display Landscape layout when device itself is in landscape mode(default). I am talking about devices that display drawer in landscape mode, and the ones that open landscape layout of apps only.
Is this automatic?
I have android:screenOrientation="portrait" in manifest.
I can't test this as I don't have a tablet/large device.
I have already looked at this question and other similar questions.
Add the below line in your onCreate() method before setContentView()
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORT‌​RAIT);

appwidget landscape scalling problems

I am testing my widget under different configs and devices.
It looks good in portrait mode in all devices that ive tried(160dp,240dp...etc)
However,
in landscape mode i had a problem. The last line of text was getting slightly clipped, so i created layout-land and customized for landscape.
all seemed to be ok, until i tested on 160dp emulator: The last line of text is gone completely! (For text size I am using dip units.)
How do you guys approach this problems? I mean, in 240dp device it looks fine, and on the 160dp the last line is totally clipped.
thank you.

froyo's universal rotation and my landscape only app

My app is set in landscape only mode thanks to an attribute in my manifest file, but with froyo came universal rotation and a problem. It will force the screen to landscape but if the user is holding the phone upside down my app will appear upside down. Is there a way for me to set my app to only rotate when the user has their phone orientented in both landscape positions?
I have one app in landscape mode and put in manifest this attribute:
android:screenOrientation="landscape"
Put this into activity and works fine for me (Froyo 2.2 Nexus One)
... By the way sorry for my english

Categories

Resources