Um, no, quite the opposite in fact.

My personal rule is to always push a complete RemoteViews update: the text views, the image id's, the pending intents, the works. This way my widget is always ready for an orientation or locale change, Launcher being kicked out of memory, etc.

Splitting widget updates into separate steps, each with its own call to updateAppWidget can lead to the widget not functioning, as there is only one RV per widget maintained by the launcher. If that RV is not complete, and one of the above events happens before you push a complete one, then the widget won't be complete either (data or intents missing).

I'm not sure what you're trying to optimize by keeping a reference to the old RV object. All it is, is just a list of pending actions (set this view to "foo", this image to "bar", etc.) that's built up on your application's side, sent over to the Launcher, and then replayed there. Building the list should be fast, I don't see this as a bottleneck.

-- Kostya

20.05.2011 23:45, Niall ?????:
Oh wait. Do you mean that I have the thing like:

    RemoteViews updateAppwidgetViews( ... ) {
      RemoteViews remoteViews = new RemoteViews( ... );
      // Set status message
      remoteViews.setTextViewText( id, "refreshing" );
      appWidgetManager.updateAppWidget( ..., remoteViews );
      // Do the rest of the stuff
      remoteViews( ..., ..., ... );
      remoteViews( ..., ..., ... );
      remoteViews( ..., ..., ... );
      remoteViews( ..., ..., ... );
      remoteViews( ..., ..., ... );
      // Done
      return remoteViews;
    }


Sorry. Wasn't quite with you. That's not a bad idea. Cheers!

Nope. It's 2.1 or 2.2. It's the only way I could simulate making a table on an appwidget... unless there's something a lot simpler that I have missed...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to