OnDisabled and onDeleted method not called

For some reason, the onDisabled and onDeleted method of my widget is not called when I remove the widget from the main screen. I do not know why.

Here is the code:

public class WidgetProvider2x1 extends AppWidgetProvider { @Override public void onEnabled(Context context) { Log.i("MyTag", "onEnabled"); super.onEnabled(context); } @Override public void onDeleted(Context context, int[] appWidgetIds) { Log.i("MyTag", "onDeleted"); Toast.makeText(context, "onDeleted", Toast.LENGTH_SHORT).show(); super.onDeleted(context, appWidgetIds); } @Override public void onDisabled(Context context) { Log.i("MyTag", "onDisabled"); Toast.makeText(context, "onDisabled", Toast.LENGTH_SHORT).show(); super.onDisabled(context); } 

LogCat also shows nothing.

+1
source share

All Articles