-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> The problem I'm having is what event to trap or how to go about
> determining which way the phone is being held.
>
The following should work from within an activity:
SensorManager sensors = (SensorManager)getSystemService(SENSOR_SERVICE);
sensors.registerListener(new SensorListener() {
@Override
public void onAccuracyChanged(int sensor, int accuracy) {
}
@Override
public void onSensorChanged(int sensor, float[] values) {
}
}, SensorManager.SENSOR_ACCELEROMETER);
I have no idea what kinds of values will be passed to onSensorChanged,
so if you figure it out, let the rest of us know!
cheers,
- --
ᛏᚠᛖᚾᚱᛁᛊᚢᛚᚠᚱᛏ
ᛏᚢᛚᚠᛊᛚᛖᛁᚠᚨᚱᛏ
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkj8qFQACgkQNig/07RbnEs0XQCeNodNI7BRjZ2zsIJA7sesA7yf
hOMAn3dIgYE3sbryei+DbHTXQFLQ5qZH
=eADV
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---