Code example for Display

Methods: getRotation

0
 
	final SensorEventListener myOrientationListener = new SensorEventListener() {
		public void onSensorChanged(SensorEvent sensorEvent) { 
			if (sensorEvent.sensor.getType() == Sensor.TYPE_ORIENTATION) { 
				mOrientationValues = sensorEvent.values; 
				mRotation = mDisplay.getRotation(); 
				mSensorsTriggered = true; 
			} 
		} 
 
		public void onAccuracyChanged(Sensor sensor, int accuracy) { 
		} 
	}; 
 
	/** return true if both a sensor and android support are available to sense device tilt 
	 */ 
	public static boolean isTiltSensingPossible() { 
		return 	isOrientationSensor() && 
				CommonUtils.isFroyoPlus(); 
	}