I'm currently having issues with my widget. I'm using a Droid 2 phone and when I open the keyboard the screen rotates and my widget never calls the onUpdate() function call.
In efforts to debug the issue I overwrote the onReceive() and noticed that after the screen is rotated I get the intent action:
com.motorola.blur.home.ACTION_WIDGET_ADDED
After the rotation of the screen the TextViews loose their content so I need to be able to set text after the rotation. I usually set the text at the onUpdate() call.
Anyone have any ideas why this issue? I'm sure I'm doing something wrong...
Thanks,
-Jona
After a lot of testing and searching online I realized something so important about Widgets.
When the screen is rotated and the widget needs to be restored the Android system will restore it using the data from the last RemoteViews update.
I was updating parts of the widget separately so when it needed to restore only one part got updated.
The fix is always update everything on your RemoteViews all at once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With