Code example for OrientationEventListener

Methods: enable

0
	 * start sensors 
	 */ 
	public void onResume() { 
		mSensorManager.registerListener(mListener, mSensorAcceleration, SensorManager.SENSOR_DELAY_GAME);
		mSensorManager.registerListener(mListener, mSensorMagnetic, SensorManager.SENSOR_DELAY_GAME);
		mOrientationListener.enable();
		toggleGPS(true); 
	} 
 
	public void setDestination(double latitude, double longitude) {
		if (null == mDestination) {
			mDestination = new Location("user");
		} 
		mDestination.setLatitude(latitude);
		mDestination.setLongitude(longitude);
		calculateDestinationAndBearing(); 
	} 
 
	/** 
	 * updates the compass to show bearing to destination 
Connect your IDE to all the code out there  Get Codota for Java