Code example for OrientationEventListener

Methods: disable

0
	protected void onPause() { 
		if (DEBUG) {
			Log.d(TAG, "onPause()");
		} 
		super.onPause(); 
		mMyOrientationEventListener.disable();
	} 
 
	@Override 
	protected void onResume() { 
		if (DEBUG) {
			Log.d(TAG, "onResume()");
		} 
		super.onResume(); 
		if (mMyOrientationEventListener.canDetectOrientation()) {
			Toast.makeText(this, "Can DetectOrientation = Enabling Listener", Toast.LENGTH_LONG).show();
			mMyOrientationEventListener.enable();
		} else { 
			Toast.makeText(this, "Can't DetectOrientation", Toast.LENGTH_LONG).show();
			finish();
		}