Java tutorial
//package com.java2s; import android.app.Activity; import android.graphics.Rect; public class Main { public static int getTitleBarHeight(Activity cx) { Rect frame = new Rect(); cx.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); return frame.top; } }