Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Rect; import android.view.View; public class Main { public static int getStatusBarHeight(View v) { if (v == null) { return 0; } Rect frame = new Rect(); v.getWindowVisibleDisplayFrame(frame); return frame.top; } }