Android examples for android.app:Window
get Window Height
import android.app.Activity; import android.content.Context; import android.util.DisplayMetrics; public class Main{ public static int getWindowHeight(Context context) { DisplayMetrics dm = new DisplayMetrics(); ((Activity) context).getWindowManager().getDefaultDisplay() .getMetrics(dm);/*from w w w .ja v a 2 s .c om*/ return dm.heightPixels; } }