Java tutorial
//package com.java2s; import android.content.Context; import android.util.TypedValue; public class Main { public static int GetActionBarHeight(Context c) { TypedValue tv = new TypedValue(); if (c.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { int height = TypedValue.complexToDimensionPixelSize(tv.data, c.getResources().getDisplayMetrics()); return height; } return 0; } }