Does this imply that EVERY RemoteViews update that I apply to my widget should be capable of COMPLETELY initializing the correct current state of every component on the widget?
Right now I am sending more frequent minor updates (that don't include re-setting button listeners, button images, etc), and have attempted to only do a full "refresh" on orientation changes, but the sequence of the ACTION_CONFIGURATION_CHANGED event and the widget UI inflation and layout does not seem to support sending a "full refresh" RemoteViews update at the time of that event. I send a RemoteViews update that resets the button listeners, but it appears that the "cached" RemoteViews is being used instead and my update is lost (or at least, applied to the previous widget on the old orientation). The effect is, after an orientation change my ImageButtons don't work and they don't reflect any updates to their images. So, in order to guarantee preserving widget state on orientation changes, should every RemoteViews update completely reset the state of all widget components? Or am I missing something here? Thanks, Blake On Jun 21, 12:20 am, Jeff Sharkey <jshar...@android.com> wrote: > > When it is initially created, the onUpdate() method of my > > AppWidgetProvider calls views.setOnClickPendingIntent(buttonID, > > pendingIntent) to register for my button events, but when the > > orientation changes, new buttons are created and I don't have an > > opportunity to re-register the "onClick" listeners. What is the proper > > way to do this? > > The system keeps a cache of the last RemoteViews update you sent, and > reapplies it to the newly inflated landscape layout automatically. :) > > -- > Jeff Sharkey > jshar...@android.com --~--~---------~--~----~------------~-------~--~----~ 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---