Sounds like a bug to me. Even though widgets are rendered by another process - the home screen - the widget provider lives in your own application's process.
What you can do is use IntentService, and push widget updates from there. It's not necessary to update widgets from within onUpdate - you can get the necessary Android service objects (like AppWidgetManager) from an IntentService, a worker thread, or anywhere really. -- K 2012/7/16 Gicci <[email protected]> > Sorry, maybe I was not clear in describing the problem. > > The description of NetworkOnMainThreadException says: > "The exception that is thrown when an application attempts to perform a > networking operation on its main thread. This is only thrown for > applications targeting the Honeycomb SDK or higher. Applications targeting > earlier SDK versions are allowed to do networking on their main event loop > threads, but it's heavily discouraged." > > The manifest where my Service is declared says that I am targeting SDK 10 > while Honeycomb is 12, so I was surprised to see this kind of exception. > > > On Sunday, July 15, 2012 3:12:16 AM UTC+2, TreKing wrote: > >> On Sat, Jul 14, 2012 at 6:12 PM, Gicci wrote: >> >>> As it seems to me that I am performing network access in the same way of >>> the provided example, is it broken as well? >> >> >> Run it and see? >> >> >>> Is it normal that as environment for the widget execution I get the one >>> of the home app and not the one I have declared? >> >> >> I think that could use some clarification. >> >> ------------------------------**------------------------------** >> ------------------------------**------- >> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago >> transit tracking app for Android-powered devices >> >> -- > 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 > -- 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

