Java tutorial
//package com.java2s; //License from project: LGPL import android.app.Activity; import android.graphics.Rect; public class Main { public static int[] sizeWithTitle(Activity activity) { Rect outRect = new Rect(); int[] size = new int[2]; activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(outRect); size[0] = outRect.width(); size[1] = outRect.height(); return size; } }