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).

On Wed, Sep 9, 2009 at 8:03 PM, mmkr <[email protected]> wrote:

>
> 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?
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to