> "I found the reason : HTC changed the Android widget management at
> startup !
> I hope they will fix it in a new ROM release, but I'd like to find a
> solution to bypass this problem.
> EDIT 28/10/2009 : problem solve for 'Pure calendar' with new option."
Thanks to another generous developer, I have learned about the
horrific mishap:
"When widgets are created and configured by the user they are each
assigned a unique ID and that ID is used by the app to store and
retrieve configuration specific to that widget during widget updates.
When the user removes a widget, the onDeleted is called by the
framework to indicate that the widget is being removed and to allow
the app to clean up after that widget.
On the Hero, when the Sense Home Screen is restarted (e.g. at power-
cycle or when the user changes Sense Scenes), HTC for some reason
calls onDeleted (without the user actually removing any widgets!) for
every widget currently installed on the home screen, effectively
telling the applications that all the widgets have been killed. Then
they attempt to re-create the widgets by calling onUpdate with new IDs
(seemingly auto-generated by HTC by incrementing a sequence). But at
this point the app has already erased the original widgets'
configuration and has no knowledge of the new IDs. For simple widgets
that can only have one possible configuration it is not a problem --
they don't use the IDs for anything and just return the same set of
data and keep on working. However in the case when the app allows
different configuration per widget instance (as is the case with FeedR
-- it allows a different feed to be associated with each widget) it is
a really big problem since I cannot just return some default/random
information and the new IDs have no user-assigned configuration
associated with them...
Many apps are affected by the problem, and even the Android Picture
Frame widget that comes preinstalled on the device is broken in the
same way (HTC Picture Frame widget works fine though)."
Here are some solutions I've thought of for my situations:
1) Popup one-time alert warning users of this problem on Hero.
2) Provide a settings option that makes the widget, so that it no
longer can have multiple instances. It will just read from a single
row in the database without regard to appwidget id.
3) Contact HTC and alert them of the problem.
I'm doing #3 as we speak!
-Brian
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment