screen size of emulator?

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


Sponsored Links
 Hai,

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

Display display = ((WindowManager) getSystemService
(Context.WINDOW_SERVICE)).getDefaultDisplay();
        int width = display.getWidth();
        Log.i("width",""+width);

But it gives me different values each time. How to find the exact
value?
--~--~---------~--~----~------------~-------~--~----~



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
hack...@android.com

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.

gl.glDisable(GL10.GL_DEPTH_TEST);

Does drawing 2D alone work?




-- 

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

As the title!

Thanks!

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

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