screen size of emulator?

by mmkr » Thu, 10 Sep 2009 11:04:56 GMT

Sponsored Links

How can i get the screen size of my emulator?
i used

Display display = ((WindowManager) getSystemService
        int width = display.getWidth();

But it gives me different values each time. How to find the exact

screen size of emulator?

by Dianne Hackborn » Thu, 10 Sep 2009 11:35:54 GMT

 You generally don't, your views get told the size they should be as part of
the view hierarchy layout.  Directly getting the size of the display is not
recommended, because it may have no relation to the actual space your UI has
available (such as if there are other screen decorations around, like a task
switcher or who knows what).

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. Drawing 2D stuff on the screen in OpenGL over a 3D scene

There's a chance that your 2D stuff is behind 3D stuff. Turning depth
test off is a good idea for drawing UI.


Does drawing 2D alone work?


2. Is there any way or tool to test NAND performance on my android phone

As the title!



3. "can not be resolved to a type" errors while generating List View in Eclipse

4. IQ Quiz to win an ipod touch

5. App failing to load on Nexus One

6. cgroup errors?

7. How to get the license type of each installed package