Okay this is getting really rather annoying now.

I have used both of the following methods of getting the screen
orientation and both do not work properly on different devices.

Method 1:
Display display = ((WindowManager) getSystemService
(WINDOW_SERVICE)).getDefaultDisplay();
int screenOrientation = display.getOrientation();

Method 2:
int screenOrientation = getResources().getConfiguration().orientation;

Both methods work fine on the HTC Hero; however, they both fail on the
G1 and G2 devices (according to the users of my app).

How can we be expected to make high quality applications if the API is
not supported on all devices???

I would be very greatful if someone could offer a solution to this,
its just not acceptable.



On Oct 31, 12:08 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> mscwd01 wrote:
> > I added this to the activity tag in the manifest:
> > android:screenOrientation="sensor"
>
> > Would that make any difference?
>
> That changes the trigger. For devices with a keyboard (e.g., G1), by
> default, an orientation change is triggered by sliding the keyboard, not
> the accelerometer. android:screenOrientation="sensor" forces it to be
> the "sensor" (a.k.a., accelerometer) like the Magic, Hero, and other
> keyboard-less devices.
>
> Since you are experiencing your problem with both the G1 (with keyboard)
> and the Magic (sans keyboard), I doubt this will help, but I could
> easily be wrong.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, $35/Year

-- 
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