I have some problems with my widgets. Here is the description:
Context:
I have a home widget.
When I add it, it pops a configuration
I had this same problem, i did this on the onPause event
public void removeWidget(int appWidgetId) {
AppWidgetHost host = new AppWidgetHost(Config.this, 1);
host.deleteAppWidgetId(appWidgetId);
}
Checked the widget ids, the widget is removed. The host id is not important if you only have one app widget host.
private boolean canceled = true;
@Override
protected void onPause() {
if(canceled) {
removeWidget(appWidgetId);
}
super.onPause();
}
In the OK click, i set the canceled
false