3

I am using Genymotion. I created layout for sw800dp tablet and sw600dp. I want my app only for portrait, so what i did

<activity android:name="TestCountry"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

Now If i run the app with genymotion emulator size 1280x800

it shows following output

enter image description here

and then press ctrl+F11 and change orientation then it shows

enter image description here

Can anyone tell why it is giving wrong output

Cœur
  • 37,241
  • 25
  • 195
  • 267
Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96
  • I get this with some GenyMotion Emulators. With two real devices running the same App results in neither flipping the screen if turned 180 degrees. It's as if setting a fixed orientation fixes it once and for all. (One, Lenovo A10-30 device is the right way up to me (power button at top), the other an Onix is the wrong way). I suspect that setting the orientation fixes the display and that it's pot luck which way. You could perhaps try `setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); ` before you call `setContentView` in the activities (I'm not sure if this fix it though). – MikeT Feb 11 '17 at 06:49
  • @MikeT Thanks, i tried as you said but its not working – Aditya Vyas-Lakhan Feb 11 '17 at 06:52
  • Did you remove it from manifest first? Not saying that will fix it but might. – MikeT Feb 11 '17 at 06:54
  • @MikeT yes i removed and tried but no luck – Aditya Vyas-Lakhan Feb 11 '17 at 06:55
  • Only other chance that I can think of is to remove from manifest add in activity and try clean and build. But I suspect that won't change anything. – MikeT Feb 11 '17 at 06:59
  • Been having a look around try `sensorPortrait` in the manifest if it will take it. This from [R.attr](https://developer.android.com/reference/android/R.attr.html#screenOrientation). There's other modes as well. – MikeT Feb 11 '17 at 07:12
  • 1
    [Screen orientation lock](http://stackoverflow.com/questions/6599770/screen-orientation-lock) could be of interest. – MikeT Feb 11 '17 at 07:20
  • @MikeT yeah thats interesting i think – Aditya Vyas-Lakhan Feb 11 '17 at 07:22
  • @MikeT it is nice solution but for landscape i am getting issue – Aditya Vyas-Lakhan Feb 14 '17 at 05:22
  • have you tried editing the settings and making the device 800x1280, this appears to start the device in portrait. – MikeT Mar 18 '17 at 03:38

0 Answers0