Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.util.TypedValue; public class Main { /** * Get ActionBar size. */ public static int getActionBarSize(Context context) { int actionBarSize = 0; TypedValue tv = new TypedValue(); if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { actionBarSize = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics()); } return actionBarSize; } }