Here you can find the source of getStatusBarHeight(Context context)
public static int getStatusBarHeight(Context context)
//package com.java2s; import android.content.Context; public class Main { public static int getStatusBarHeight(Context context) { int result = 0; int resourceId = context.getResources().getIdentifier( "status_bar_height", "dimen", "android"); if (resourceId > 0) { result = context.getResources().getDimensionPixelSize( resourceId);//from w w w .j a va2 s.c o m } return result; } }