Try this:
Rect rect = new Rect();
Window win = activity.getWindow();
win.getDecorView().getWindowVisibleDisplayFrame(rect);
int statusBarHeight = rect.top;
int contentViewTop =
win.findViewById(Window.ID_ANDROID_CONTENT).getTop();
int titleBarHeight = contentViewTop - statusBarHeight;

-Ritu

On May 5, 10:20 am, rajesh chandrasekaran <[email protected]>
wrote:
> Hi all,
>
>    I am new in android, i am getting the width and height for the
> screen using below code
>
>             WindowManager w = getWindowManager();
>             Display d = w.getDefaultDisplay();
>             int totalwidth_screen = d.getWidth();
>             int totalheight_screen = d.getHeight();
>
> But i need to get screen height minus the title bar and status bar.
> how to get it???
>
> Thanks
> C.Rajesh
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to