Code example for Point

Methods: getSize

0
	public static int[] getScreenSize(Context context)
	{ 
		int screenSize [] = new int[2]; 
		int Measuredwidth = 0;
		int Measuredheight = 0;
		Point size = new Point();
		//WindowManager w = (WindowManager) getActivity().getWindowManager(); 
		WindowManager w = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE));
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2){
			w.getDefaultDisplay().getSize(size);
 
			Measuredwidth = size.x;
			Measuredheight = size.y; 
		}else{ 
			Display d = w.getDefaultDisplay(); 
			Measuredwidth = d.getWidth(); 
			Measuredheight = d.getHeight(); 
		} 
		screenSize[0] = Measuredwidth;
		screenSize[1] = Measuredheight;
Connect your IDE to all the code out there  Get Codota for Java