Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.util.TypedValue; public class Main { static int getActionbarSize(Context context) { int actionbarSize = -1; TypedValue typedValue = new TypedValue(); if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, typedValue, true)) { actionbarSize = TypedValue.complexToDimensionPixelSize(typedValue.data, context.getResources().getDisplayMetrics()); } return actionbarSize; } }