How to get the visible size on an Activity?
I think you'll want to look at Activity.getWindow()
and Window.getDecorView()
, and get the width/height of that.
I like time-saving answers more:
myActivity.getWindow().getDecorView().getHeight();
myActivity.getWindow().getDecorView().getWidth();
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.