Resizable appwidgets in Android 3.1

Viewed 728

I was happy to see support for resizable appwidgets arrive with Android 3.1, but I'm stumped on how to make them actually work.

I'm no appwidget novice, and have no problem adding

android:resizeMode="horizontal|vertical"

to my appwidget definition XML. And that works as far as it goes, the widget is nominally resizable (long-press on it and handles appear that let me drag the border to different sizes).

Two problems, though:

First, it doesn't appear that my code gets called when the widget is resized. A breakpoint set in my onReceive() handler never gets hit.

Second, assuming that I can get into my code, I can't see anywhere in the docs to get the current size of the widget. I'm already using calls to AppWidgetProviderInfo.minWidth and .minHeight, but those only reflect the minimum dimensions given in the XML, they don't change at runtime.

So, how is one meant to actually implement a resizable widget?

1 Answers
Related