In xml, you can use ?attr/actionBarSize, but if you need access to that value in Java…

public int getActionBarSize() {
  TypedArray styledAttributes = getTheme().obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });
  int actionBarSize = (int) styledAttributes.getDimension(0, 0);
  styledAttributes.recycle();
  return actionBarSize;
}