In xml, you can use ?attr/actionBarSize, but if you need access to that value in Java…
1 2 3 4 5 6 |
public int getActionBarSize() { TypedArray styledAttributes = getTheme().obtainStyledAttributes(new int[] { android.R.attr.actionBarSize }); int actionBarSize = (int) styledAttributes.getDimension(0, 0); styledAttributes.recycle(); return actionBarSize; } |