Android StatusBar Size Get getStatusBarHeight(Context context)

Here you can find the source of getStatusBarHeight(Context context)

Description

get Status Bar Height

Declaration

public static int getStatusBarHeight(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;

public class Main {
    public static int getStatusBarHeight(Context context) {
        int result = 0;
        int resourceId = context.getResources().getIdentifier(
                "status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = context.getResources().getDimensionPixelSize(
                    resourceId);//from   w  w w .j  a  va2  s.c  o m
        }
        return result;
    }
}

Related

  1. getStatusBarHeight(Activity activity)
  2. getStatusBarHeight(Activity activity)
  3. getStatusbarHeight(Activity activity)