Android land-layout doesn't work on real device - android

I'm having a problem with the layout orientation.
I've recently made a android app that has a layout and layout-land but the problem is
that when I test it on the emulator the screen orientation works, but when I install the
apk into a real android device, the layout-land xml doesn't work even I tilt the device.
I've made 2 layout folder for layout-land and layout and set up the xml file with the same
name into it, and it works fine with the emulator but not in real device . I've checked the android device I tested and their is no problem with the settings. Sorry for my bad English.

Valid Names for Tablet :
layout-sw600dp-land
layout-sw720dp-land
Check your manifest you must add : android:configChanges="orientation" .. to your activities
with android:theme="#android:style/Theme.Translucent.NoTitleBar"
you must add android:screenOrientation="sensor"

Related

Android, landscape only view orientation - Phone and Tablet

I'm trying to create an android app with a fixed landscape orientation so I updated the manifest to include the following
activity android:name=".MainActivity"
android:screenOrientation="sensorLandscape"
This worked perfectly on a Pixel 2 phone, but when I opened the app on a Nexus 9 Tablet the orientation matched the rotation of the device as if I had done nothing.
Why is this happening and what can I do to resolve the issue?
I'm fairly novice, so please keep things simple.
cheers
Try adding
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
to your OnCreate method and see what happens

App logo not showing on different devices

I have a samsung phone and a Motorolla phone. On my Samsung phone my propgrammed and set custom app icon is used and displayed. On my Motorolla this is not the case. Instead the default android logo remains. Any clue why this is?
follow these steps :
1) add app icon in mipmap folder with different sizes
2) In Menifest.xml set android:icon="#mipmap/app_icon" and android:roundIcon="#mipmap/app_icon"
^ Make sure you have added android:roundIcon="#mipmap/ic_launcher_round" in manifest file

Trouble viewing application on physical device

This is my app in physical devic
This is my app in emulator
I have a problem in view the application in the real machine as you see in image1 Changing right to left and vice versa . While this problem does not exist in the emulator as you see in image2 .
Perhaps the whole thing in support of Right-to-left,
see locale on your device and emulator.
Do you have android:supportsRtl="true" to the <application> element in your manifest file?
More info there - http://android-developers.blogspot.ru/2013/03/native-rtl-support-in-android-42.html

App not showing on portrait mode in Galaxy m pro

i have created an application which is only work on potrait mode, Samsung screening review give a issue application work on landspace mode on Mid-end Galaxy (LQVGA), They also give video for same to identify, i found they are right, My app show in landscape mode for that device, but i am not able to find the reason, Why this is happen, because except that device my app work fine on all device, i also find device name is Galaxy M pro , i am attaching file screen shot of issue, please suggest me any way to resolve this issue, i already added android:screenOrientation="portrait" that in all activity of manifest.xml file

Orientation change: reloading layouts from resources

I want to adapt my app for tablets with large and xlarge screens (Android 3.0+ or API level 11+). Therefore, I created two folders: res/layout-large-port-v11 and res/layout-large-land-v11. When I first rotate my tablet and then launch the app, everything works well, but when I rotate the tablet while my app is working, Android stretches and rotates old layout, but doesn't load the proper one (proper for new orientation). What's wrong?
My tablet is Acer Iconia A500 (Honeycomb 3.2, API level 13)
You can see AndroidManifest.xml and all code in the app's repo on github. DashboardActivity contains all logic for tablets.
P.S.: Everithing still works pretty well on my Android 2.2 phone with normal screen. Maybe something wrong with qualifiers? Maybe I should also create -v12, -v13 -v14 and -xlarge duplicates of the two folders?
Have you tried removing orientation from configChanges? With this declaration, you are overriding the default behaviour of Android when changing orientation - this may (or may not) lead to problems like the one you described.

Categories

Resources