westmeadboy wrote: > Sure, my widget changes from time-to-time but I'm just curious why > that particular method is called each time the widget is updated? It > seems that all calls (after the first one) to setOnClickPendingIntent > () are redundant. Is that correct?
First, you have no really good way of knowing which is the first time. My sincere hope is that all your code in support of your app widget closes up when it is not directly in use. Since there is no good way that I know of to save state in an app widget itself, it might be tricky to determine which ones are "after the first one". Second, based on other work that I have done, I am under the impression that the widget gets redrawn completely with the RemoteViews on every update pass. In other words, if you don't call setOnClickPendingIntent() on the second update, your button (or whatever) will no longer respond to clicks...since the old PendingIntent was replaced by nothing. Now, I have not attempted to prove the second theory, in part because of the problems presented by the first issue above -- it's a minor pain to set up the test. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Beginning Android_ from Apress Now Available! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

