Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; public class Main { public static int getStatusBarHeight(Context context) { int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resId > 0) return context.getResources().getDimensionPixelSize(resId); else return 0; } }