Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.content.res.TypedArray;

public class Main {
    public static int getActionBarHeight(Context context) {
        int[] attrs = new int[] { android.R.attr.actionBarSize };
        TypedArray styledAttributes = context.getTheme().obtainStyledAttributes(attrs);
        int actionBarHeight = (int) styledAttributes.getDimension(0, 0);
        styledAttributes.recycle();
        return actionBarHeight;
    }
}