Java tutorial
//package com.java2s; import android.app.Activity; public class Main { public static int getStatusBarHeight(Activity context) { int result = 0; int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = context.getResources().getDimensionPixelSize(resourceId); } return result; } }