-1

If I have created an Android app and I use a emulator. I would to know If I use horizontal or vertical screen by using java code.

Is there a syntax that gives a feedback if current situation if horcontal or vertical screen?

Thank you!

HelloWorld1
  • 12,940
  • 25
  • 73
  • 128
  • https://stackoverflow.com/questions/10380989/how-do-i-get-the-current-orientation-activityinfo-screen-orientation-of-an-a – HelloWorld1 Feb 11 '18 at 22:37

1 Answers1

0

You may obtain current orientation from resources context.getResources().getConfiguration().orientation

Note that there are 4 posiible values: landscape, portrait, undefined and square (deprecated since API level 16)

Andrew
  • 1,343
  • 7
  • 20