Android examples for android.app:Status Bar
get Status Bar Height from window top
import android.content.Context; import android.graphics.Rect; import android.view.View; public class Main { public static int getStatusBarHeight(Context context) { Rect frameRect = new Rect(); View view = new View(context); view.getWindowVisibleDisplayFrame(frameRect); return frameRect.top; }// w w w .j ava 2s . com }