Or like so:

Display display = 
((WindowManager).getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
float width = display.getWidth();
float height = display.getHeight();


On Friday, July 20, 2012 1:06:36 PM UTC-5, Dianne Hackborn wrote:
>
> I recommend never using them.  The real correct size will be given to you 
> through the view hierarchy.
>
> On Thu, Jul 19, 2012 at 7:32 PM, Agus <agus.sant...@gmail.com> wrote:
>
>> What are the uses cases in which width and height values of 
>> DisplayMetrics used ?
>>
>> Is it just for games ?
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> -- 
> 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.
>
>

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

Reply via email to