Hi,

 You can use the following code to get the screen size:

  Display display = getWindowManager().getDefaultDisplay();
  int screenWidth=      display.getWidth();
  int screenHeight=      display.getHeight();

  Please read the post from Dianne below about the implications of using
this for getting the screen dimensions:
  http://groups.google.com/group/android-developers/msg/ecc211538e5c27e2

Thanks,
Megha



On Thu, Apr 3, 2008 at 7:32 AM, Agus <[EMAIL PROTECTED]> wrote:

>
> Hi all,
>
> I am getting both 0 for accessing the device screen dimensions using
> DisplayMetrics
>
> new DisplayMetrics().widthPixels return 0
> new DisplayMetrics().heightPixels return 0
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to