Reputation: 3177
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
Reputation: 42016
Display mDisplay= activity.getWindowManager().getDefaultDisplay();
int width= mDisplay.getWidth();
int Height= mDisplay.getHeight();
Upvotes: 2
Reputation: 15108
getWindowManager().getDefaultDisplay()
You might also want to read this: http://d.android.com/guide/practices/screens_support.html
Upvotes: 1