Hello everyone ,
I was working on status bar and found that we could get the height of the navigation bar at runtime.
following is the code to get the height of the status bar.
private int getStatusBarHeight() {
int result = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
return result;
}
Happy coding :)
0 Comment(s)