[android-developers] Re: How to detect current screen is vertical or horizontal?

2009-06-03 Thread Sujay Krishna Suresh
use an orientation sensor... On Wed, Jun 3, 2009 at 2:13 PM, aby orz0...@gmail.com wrote: Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?Thanks -- Regards, Sujay Mark Twain

[android-developers] Re: How to detect current screen is vertical or horizontal?

2009-06-03 Thread guna
getRequestedOrientation() method will work until you forced to change the Orientation. On Wed, Jun 3, 2009 at 2:21 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: use an orientation sensor... On Wed, Jun 3, 2009 at 2:13 PM, aby orz0...@gmail.com wrote: Hi, I need to set

[android-developers] Re: How to detect current screen is vertical or horizontal?

2009-06-03 Thread Hiro
not sure how much help this is, but i'm using it on a canvas i have Integer width = canvas.getWidth(); Integer height = canvas.getHeight(); // Check Orientation so we know which grid to use

[android-developers] Re: How to detect current screen is vertical or horizontal?

2009-06-03 Thread radiolistener
Try This, WindowManager z; z = this.getWindowManager(); Display r = z.getDefaultDisplay(); int rr = r.getOrientation(); HTH, Radio On Jun 3, 5:40 pm, Hiro the.h...@gmail.com wrote: not sure how much help this is, but i'm using it on a canvas

[android-developers] Re: How to detect current screen is vertical or horizontal?

2009-06-03 Thread Jeff Sharkey
The easiest way of showing a different layout based on orientation is to build it into your resources folders, and there is no extra code needed. Here's an example of how I use two different layouts depending on portrait or landscape: