Lucas Gaspar
Lucas Gaspar

Reputation: 331

How can I get the device screen size in AndroidStudio?

I need to get the size of the screen ( width and height). How do I do this? Is for a game that is being developed with libGDX.

Upvotes: 0

Views: 451

Answers (1)

MilanG
MilanG

Reputation: 7124

int width = Gdx.app.getGraphics().getWidth();
int height = Gdx.app.getGraphics().getHeight();

This should do the trick.

Upvotes: 1

Related Questions