Android examples for User Interface:StatusBar
get StatusBar Height from 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);/*w w w . j av a2 s.c o m*/ } return result; } }