i am trying to ge the status bar height and it successfully works in 2.3. But when i run the same code on 4.0+, it will return as 0.
here is the code i am using...
Rect rectgle= new Rect();
Window window= getWindow();
window.getDecorView().getWindowVisibleDisplayFrame(rectgle);
int StatusBarHeight= rectgle.top;
int contentViewTop=
window.findViewById(Window.ID_ANDROID_CONTENT).getTop();
int TitleBarHeight= contentViewTop - StatusBarHeight;
Context context = getApplicationContext();
CharSequence text = "DETERMINED STATUSBAR HEIGHT - "+TitleBarHeight;
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
Any input would be awesome!