N
N
Nikolay2015-01-02 01:31:00
Android
Nikolay, 2015-01-02 01:31:00

How to find out screen width (android)?

Display display = getWindowManager().getDefaultDisplay();
game_area_params.height = game_area_width = game_area_height = game_area_params.width = display.getWidth();
"display.getWidth()" - this method is deprecated, but I can't find another solution. Tell me how to get the screen width in modern programming for the android platform?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2015-01-02
@tryvols

Google, when indicating that a method is deprecated, tends to indicate an alternative in the documentation
developer.android.com/reference/android/view/Displ...
Use getSize(Point) instead.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question