Hi Dianne One of the main issues I'm having with Android is supporting all major API levels. A lot of problems could be solved easily if I had to support only the newer version but my apps need to run on Android>=1.6 (finally decided not to support 1.5 any longer). As much as I appreciate all the new cool stuff Google is bringing with the new versions of Android most of these functions are pretty useless to me. Of course I'm using reflection in certain cases but that's honestly not my preferred programming style. SCREENLAYOUT_SIZE_XLARGE unfortunately isn't supported before Gingerbread so it's either using reflection or my approach (maybe there are other solutions) to _really_ solve Droid's problem (I agree that the nosensor approach is not the right one).
Also I want to thank you for your ongoing and very helpful support in this forum. I really appreciate it. Emanuel Moecklin 1gravity LLC On May 9, 5:06 pm, Dianne Hackborn <[email protected]> wrote: > You don't need to do that work to find the size of the screen. In the > activity, just getResources().getConfiguration(), and in the Configuration > object is the screen size along with many of the other resource > configurations. > > On Mon, May 9, 2011 at 4:55 PM, Emanuel Moecklin <[email protected]>wrote: > > > > > > > > > > > Not simple but doable: > > > 1. Create an abstract custom view MyView with a method "public boolean > > isXLarge()" > > 2. Create two sub classes MyView1 and MyView2. MyView1 returns false > > in isXLarge(), MyView2 returns true. > > 3. Add MyView1 to the three portrait layouts (in layout-small, layout- > > normal and layout-large) and MyView2 to the landscape layout (in > > layout-xlarge) > > 4. In your activity get the MyView view (using findViewById) and check > > isXLarge(). If the method returns true then set the orientation of the > > activity to landscape, otherwise to portrait: > > e.g. > > activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); > > > Emanuel Moecklin > > 1gravity LLC > > > -- > > 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 > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- 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

