Skip to content

Instantly share code, notes, and snippets.

@stephenparish
Created July 27, 2014 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stephenparish/5d9c3ce662569ecd712b to your computer and use it in GitHub Desktop.
Save stephenparish/5d9c3ce662569ecd712b to your computer and use it in GitHub Desktop.
Get android status bar height
public int getStatusBarHeight() {
int result = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment