This only gets the minHeight that is mentioned in the appwidget-provider 
xml file, not the actual size of widget.
for example if you set the minHeight to 70dp, it always gets this height 
multiplied with the displayMetrix.
so in HDPI it will be 70*1.5,
and in MDPI it will be 70*1, and so on.
I have the same problem and I cannot get the actual size of the widget.
I need something like getMeasuredHeight in a view.

On Tuesday, May 11, 2010 6:04:17 AM UTC+3, String wrote:
>
> Here's what works for me: 
>
> First, in your manifest XML, make sure you have <supports-screens 
> android:anyDensity="true" />. AFAIK, if that's set to false, the 
> platform always pre-scales your widget to MDPI-standard measurements. 
>
> Then in your ACTION_APPWIDGET_UPDATE handler, you'll need to get an 
> AppWidgetProviderInfo object (using 
> AppWidgetManager.getAppWidgetInfo). With that, reference its minHeight 
> property (like providerInfo.minHeight) to get the real pixel size of 
> the widget. 
>
> String 
>
> On May 10, 9:15 pm, James <[email protected]> wrote: 
> > I'm writing a widget at the moment. It's supposed to fill one cell, so 
> > I've set the size to be 72dp by 72dp. The layout has a linear layout 
> > containing a 72x72dp ImageView. 
> > 
> > In onUpdate(), I call views.setImageViewBitmap with a 72px x 72px 
> > bitmap. This worked fine under Android 1.5 on my G1, but now I have a 
> > Nexus One, the image gets stretched to fill the cell, and looks 
> > blurry. 
> > 
> > What is the correct, device independent way, to work out how big the 
> > bitmap should be? 
> > 
> > James Ots 
> > 
> > -- 
> > 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]<javascript:> 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > For more options, visit this group athttp://
> groups.google.com/group/android-developers?hl=en 
>
> -- 
> 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]<javascript:> 
> To unsubscribe from this group, send email to 
> [email protected] <javascript:> 
> For more options, visit this group at 
> http://groups.google.com/group/android-developers?hl=en

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