Code example for Display

Methods: getOrientation

0
		display = activity.getWindowManager().getDefaultDisplay();
		updateOrientationInfo(); 
	} 
	 
	private void updateOrientationInfo() { 
		rotateOrientation = (display.getOrientation() == Surface.ROTATION_90) ? true : false;
	} 
 
	public float getX() { 
		return (rotateOrientation) ? gravs[1] :-gravs[0];
	} 
 
	public float getY() { 
		return (rotateOrientation) ? gravs[0] : gravs[1];
	} 
 
	public float getZ() { 
		return gravs[2];
	} 
 
	public void onAccuracyChanged(Sensor sensor, int accuracy) {