OnDeleted method does not start when appwidget is deleted

The onDeleted method onDeleted not start when appwidget is removed from the main screen.

What could be the problem?

+1
source share
1 answer

This is apparently a fairly common problem with Android widgets.

If you subclass AppWidgetProvider, onDelete () cannot be called. To get around this, you can instead implement the onReceive () method and explicitly look for APPWIDGET_DELETED.

Literature:
- https://groups.google.com/forum/?fromgroups=#!topic/android-developers/Nl0e06rDCRY - http://blog.elsdoerfer.name/2009/06/03/writing-an-android-widget- what-the-docs-dont-tell-you /

+1
source