21.05.2011 0:17, Niall ?????:
Remember, I want to notify the user about the fact that I'm updating
the status of the table. So I need to first change the status message
*and* then update the table with the new data that I parse from a
website. Which requires two appWidgetManager.updateAppWidget calls.
Understood.
If you push an update to just the message, I would also hide all (most)
of the rest of the widget, so there is no possibility of an inconsistent
state.
All I'm thinking is that if I keep a record of the previous full
single remote views that was used to conjure the appwidget's layout
that I could do this much simpler rather than having to generate
layouts, intents, pending intents, table, background colour/alpha,
text colour. It just seems a lot more reasonable to me... isn't it?
It would, except you'd need to track launcher configuration changes or
your app being killed, which seems really messy and error prone.
But If you want to save the time it takes to build RemoteViews with the
list, the color, the intents...
I'd say, first, measure it.
Second, if it turns out expensive, make one that has actions that are
common for all cases, save it as a sort of a microwave dinner box, and
clone new ones ('reheat'), perhaps by writing it to a parcel and reading
a new one. Then add just what's different for that particular update
('salt and pepper') and you're done. Still not necessarily faster (in a
significant way) than just building a new RV from scratch, so you might
want to measure it afterwards.
--
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