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