get Action Bar Height - Android android.app

Android examples for android.app:Action Bar

Description

get Action Bar Height

Demo Code

import android.content.Context;
import android.content.res.TypedArray;

public class Main{

    public static float getActionBarHeight(Context context) {
        TypedArray actionbarSizeTypedArray = context
                .obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });

        float h = actionbarSizeTypedArray.getDimension(0, 0);
        return h;
    }/*from   ww  w  .  jav  a2  s. co m*/

}

Related Tutorials