Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?

I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?
6.Does android have support Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?



I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?
6.Does android have support type:Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?



I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?

6.Does andorid have support sensor type:SENSOR_LIGHT?

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