Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the visible size on an Activity?

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.

like image 499
Tsimmi Avatar asked Jun 17 '10 09:06

Tsimmi


People also ask

How to get height of activity?

I've found a way to know the exact height of my activity: if you have a view filling all the available screen behind the title bar and the task bar, just use View. getBottom() to get the real height of that activity.

What is visible size?

Light visible from the star Deneb covers a minuscule fraction of your visual field (its 'angular diameter' is 0.0024 arcseconds). A light-emitting object seen as the same size when 15cm from your face, would be 1.75 nanometres wide. That's only about 10 times the width of an atom of gold!


1 Answers

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

like image 187
Dave Avatar answered Sep 18 '22 21:09

Dave