[SOLVED] How to know the screen orientation on start up ?

Put your problem here if it does not fit any of the other categories.

[SOLVED] How to know the screen orientation on start up ?

Postby tikimove » Fri Mar 13, 2009 9:50 am

Hi all,

In the onCreate method, I would like to determinate what is the current orientation of the screen. How can I find it ?

Thank you
Sebastien
Last edited by tikimove on Fri Mar 13, 2009 10:34 am, edited 1 time in total.
tikimove
Developer
Developer
 
Posts: 30
Joined: Tue Jan 13, 2009 2:59 pm

Top

Re: How to know the screen orientation on start up ?

Postby sarangkulkarni17 » Fri Mar 13, 2009 10:18 am

tikimove wrote:Hi all,

In the onCreate method, I would like to determinate what is the current orientation of the screen. How can I find it ?

Thank you
Sebastien


Hello tikimove,
use this code

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
  3.  
  4. {
  5.  
  6. }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
sarangkulkarni17
Developer
Developer
 
Posts: 29
Joined: Fri Feb 13, 2009 10:00 am
Location: Pune

Postby tikimove » Fri Mar 13, 2009 10:34 am

It works well, thank you very much :)
tikimove
Developer
Developer
 
Posts: 30
Joined: Tue Jan 13, 2009 2:59 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests