Java tutorial
//package com.java2s; //License from project: Apache License import android.app.Activity; import android.graphics.Rect; public class Main { public static int getScreenStatusBarHeight(Activity activity) { Rect frame = new Rect(); activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); return frame.top; } }