Code example for Point

Methods: set

0
	} 
 
	@SuppressWarnings("deprecation") 
	public static Point getScreenDimensions(Context context) {
		boolean oldWay = true;
		Point size = new Point();
 
		WindowManager wm = (WindowManager) context
				.getSystemService(Context.WINDOW_SERVICE);
		Display display = wm.getDefaultDisplay();
		if (Compatibility.isCompatible(Build.VERSION_CODES.HONEYCOMB_MR2)) {
			try { 
				Method method = Display.class.getDeclaredMethod("getSize",
						new Class[] { Point.class });
				method.invoke(display, size);
				oldWay = false;
			} catch (Exception e) {
				oldWay = true;
			} 
		} 
		if (oldWay) {
			size.set(display.getWidth(), display.getHeight());
		} 
		return size;
	} 
 
	/**