0

How can I get the screen size with code, as in:

small or normal or large or xlarge

Thanks

EDIT: It is not the dimensions I want, I would like the thing that defines either if it is small, normal, large or xlarge, like what you have in layout folders, /res/layout-normal or /res/layout-xlarge

Alexandre Hitchcox
  • 2,704
  • 5
  • 22
  • 33

1 Answers1

4

Use the DisplayMetrics class. Here's a nice sample for you.

Peter Lillevold
  • 33,668
  • 7
  • 97
  • 131