There are basically two ways to end up with phantom widgets being supplied to your WidgetProvider. In the first instance, its because the user chose to add a widget, but then cancelled its configuration. To partially overcome this problem, you can keep a list of all the widgets you know have been configured and not deleted (or something functionally equivalent), and then ignore updates for widgets not on that list.
In the second instance, widgets that have been removed by the user continue to be supplied until a new widget from the same provider is added. There's no way of detecting that this is occurring - there's no workaround*, mainly because the framework is doing its job and is properly insulating the widget provider from the widget host. *One utterly evil workaround that just entered my head as I typed that sentence could be to include an ImageView with a source that pointed back to a content provider in your application. Absence of a requests to the content provider while the phone is powered could be used to infer that the widget is phantom. This cure is almost certainly worse than the disease. Tom. 2009/5/16 guruk <ilovesi...@gmail.com> > > :) now step by step i come closer. > > I can catch when a widget come deleted > but still the phantom widgets are in the appWidgetIds listed > > Is there any way to delete this phantom widgets from my list > or get a working list of the active installed widgets? > > or is the only way to make my own list of created and deleted > widgets? > > thanks > chris > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---