Code example for Display

Methods: getSize

		WindowManager wm = getWindowManager(); 
		Display d = wm.getDefaultDisplay();
		// the displays method to get size is deprecated, so use Point instead 
		Point size = new Point();
		int width = size.x;
		int height = size.y;
		// width is greater then height which means landscape mode 
		if (width > height)
			//---landscape mode---			             
			// refers to the content  
			// view of the activity         
			fragmentTransaction.replace(, landscape_fragment);
Contextual code suggestions in your IDE  Get Codota for Java