Skip to content

Instantly share code, notes, and snippets.

@theyann
Created November 14, 2015 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theyann/210f0d1b92802abc1aaa to your computer and use it in GitHub Desktop.
Save theyann/210f0d1b92802abc1aaa to your computer and use it in GitHub Desktop.
AppWidgetProvider for configurable widget, onDelete example
@Override
public void onDeleted(Context context, int[] appWidgetIds) {
super.onDeleted(context, appWidgetIds);
WidgetEntryDao dao = new WidgetEntryDao(new DbHelper(context));
final int N = appWidgetIds.length;
for (int i = 0; i < N; i++) {
dao.deleteByWidgetId(appWidgetIds[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment