It is important since the cloud server I am working with needs to know the layout I am using before I start my session.
On Mon, Mar 4, 2013 at 6:37 PM, Piren <[email protected]> wrote: > If you dont want to base on pre-existing values you can just measure your > existing views. This will need to happen AFTER the rotation... so your best > bet is to refactor your code to work after rotations and not before (which > is kind how it should be). > > Why is doing it before the rotation is important to you? > > > On Monday, March 4, 2013 5:40:02 PM UTC+2, AndroidCompile wrote: >> >> Hi, >> I am trying to figure out the screen size I will have in portrait and in >> landscape at the beginning of my app. >> I can get the real display size using Display.getRealSize() and then >> calculate the navigation bar height in case there is one. >> However, in devices with 600dp or less the navigation bar can have >> different heights (depending on orientation) and may even move to the right >> in landscape mode. >> My app would needs to know these paramters when it begins (the app is >> connected to a cloud server that receives these dimensions when it connects >> - so I really need to know these before the app starts doing things). >> >> My current solution is this: >> id = res.getIdentifier("navigation_**bar_height", "dimen", >> "android"); >> int navigation_bar_height = res.getDimensionPixelSize(id); >> >> Although this works, it is never a good practice to use android's >> internal resources. >> Is there any other way of knowing the dimensions of the screen in a >> different orientation BEFORE you rotate the device? >> > -- > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Android Developers" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/android-developers/hnjklrR_IdU/unsubscribe?hl=en > . > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

