This is an artifact of a continously evolving platform.

I'd say, use Java reflection to access the new methods that give you new
orientation values, and fall back on the deprecated method if running on
older platforms.

Reverse Landscape was only introduced in API level 8, so the earlier
platforms don't have this notion yet.

IMO, it's ok to use a deprecated method like this - after all, documenting
an API as obsolete because there is a newer API in the newer platform
doesn't change anything on devices with older firmware that are already out
there, or in the applications written for earlier platform versions.

The intent is to say "don't use this if you can use the newer API", but for
older platforms, there isn't anything else but the old API, so go ahead and
use it as a fallback.

-- Kostya

2011/1/14 Phil Endecott <spam_from_goo...@chezphil.org>

> On Jan 11, 5:00 pm, Phil Endecott <spam_from_goo...@chezphil.org>
> wrote:
> > There is a deprecated method Display.getOrientation().  Perhaps that
> > is what I'm supposed to use, however its docs seem to have been
> > removed when it was deprecated (Please Don't Do That!).  Googling
> > suggests that perhaps it returns values like
> > Configuration.ORIENTATION_PORTRAIT and
> > Configuration.ORIENTATION_LANDSCAPE, i.e. not including "left" or
> > "right" or "upside-down" information, making it useless.
>
> Experimenting with the Google Maps app, it seems that its compass
> arrow points the wrong way in one of the two landscape orientations.
> So my guess is that it is using Display.getOrientation(), and then
> guessing wrongly 50% of the time if the answer is "landscape".  (It
> doesn't seem to allow upside-down portrait.)
>
> Is there really no better way to do this?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to