Code example for OrientationEventListener

Methods: canDetectOrientationenable

0
						changeRotation(mOrientation, lastOrientation);
					} 
				} 
			}; 
		} 
		if (mOrientationEventListener.canDetectOrientation()) {
			mOrientationEventListener.enable();
		} 
	} 
 
	private void changeRotation(int orientation, int lastOrientation) {
		switch (orientation) {
		case ORIENTATION_PORTRAIT_NORMAL:
			Log.v("CameraActivity", "Orientation = 90");
			break; 
		case ORIENTATION_LANDSCAPE_NORMAL:
			Log.v("CameraActivity", "Orientation = 0");
			break; 
		case ORIENTATION_PORTRAIT_INVERTED:
			Log.v("CameraActivity", "Orientation = 270");
Stop searching for code, let great code find you!  Add Codota to your java IDE