yoshi24
yoshi24

Reputation: 3177

How to get screen size and respond to it?

I am building a application for android honeycomb and regular phones.I want to be able to test if the screen is a certain size and respond to it a certain way. How would i go about getting the screen size in code?

Upvotes: 1

Views: 1052

Answers (2)

Display mDisplay= activity.getWindowManager().getDefaultDisplay();
int width= mDisplay.getWidth();
int Height= mDisplay.getHeight();

Upvotes: 2

Related Questions