public class OrientationListener
extends java.lang.Object
implements android.hardware.SensorEventListener
限定符和类型 | 类和说明 |
---|---|
static interface |
OrientationListener.OnOrientationListener
监听接口类
|
构造器和说明 |
---|
OrientationListener(android.content.Context context)
构造函数
|
限定符和类型 | 方法和说明 |
---|---|
void |
onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy) |
void |
onSensorChanged(android.hardware.SensorEvent event) |
void |
registerListener()
注册加速度和地磁场传感器监听
在onResume中调用
|
void |
setOnOrientationListener(OrientationListener.OnOrientationListener onOrientationListener)
设置监听
|
void |
unregisterListener()
解除监听
onPause中进行调用
|
public OrientationListener(android.content.Context context)
context
- public void setOnOrientationListener(OrientationListener.OnOrientationListener onOrientationListener)
onOrientationListener
- public void registerListener()
注册加速度和地磁场传感器监听 在onResume中调用
public void unregisterListener()
解除监听 onPause中进行调用
public void onSensorChanged(android.hardware.SensorEvent event)
onSensorChanged
在接口中 android.hardware.SensorEventListener
public void onAccuracyChanged(android.hardware.Sensor sensor, int accuracy)
onAccuracyChanged
在接口中 android.hardware.SensorEventListener