How to get the visible size on an Activity?

Tsimmi picture Tsimmi · Jun 17, 2010 · Viewed 58.5k times · Source

How can I know the visible size of my activity?

I'm trying to get the Activity real size,
not the height and width from getHeight() and getWidth(),
which gives me the screen full size.

Answer

Dave picture Dave · Jun 17, 2010

I think you'll want to look at Activity.getWindow() and Window.getDecorView(), and get the width/height of that.