I received the following response from a post I made on Google Groups that solved my problem. I canβt say if it will solve the original problem with the poster, but I would publish it if someone else comes across this problem. Link to a post on Google Groups:
http://groups.google.com/group/android-developers/browse_thread/thread/ca8c2958b6dc086c#
When changing the configuration, there is no onUpdate. The home screen recreates your widget, then takes the most recent RemoteViews and applies it to the widget.
I thought it was a recreation of the widget while rotating. The problem is I do not seem to receive any messages about this, and in no way (I see) restore the connection. How can I detect that a rotation has occurred and set up a new onClick link?
As I said, you cannot (identify or respond to a change in orientation).
What you do, make sure that every time your code pushes the RemoteViews object into the home application for your widget, it is complete in every way:
- Image resource identifier;
- Has text bites;
- Has pending intentions.
Do not do "incremental" updates to the widget, as if you were doing regular activity - first do not set intentions, then images, then text reflecting current information.
The home application starts as a separate process, and its state may fail with your widget receiver. When this happens, the only thing it has to recreate the widget is your last RemoteViews object. If it is complete, and has all parts, everything will work fine. If it only has the most recent text or image change, earlier updates that had intentions will be lost.
http://kmansoft.wordpress.com/2010/05/23/widgets-and-orientation-chan ...
- Kostya
John gaby
source share