plusonelabs / calendar-widget

An calender widget for your Android home screen.
Apache License 2.0
369 stars 126 forks source link

Allow widgets to be removed from the settings #295

Closed ghost closed 4 years ago

ghost commented 5 years ago

I use Open Launcher and when I remove a home panel which contains widget, the widget settings remain in the application, eventually cluttering it with widgets that should no longer exist.

calendar-widget

yvolk commented 4 years ago

I checked the source code, and I see that this is not our widget ("ToDo Agenda" now) that remembers all widgets, but Android System that tells us, which widgets do exist.

    public static int[] getWidgetIds(Context context) {
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        return appWidgetManager == null
                ? new int[]{}
                : appWidgetManager.getAppWidgetIds(new ComponentName(context, AppWidgetProvider.class));
    }

Our widget only stores its own view settings for the widgets, created and stored outside of it.

There is no programmatic way to delete widgets either: i.e. from the app that didn't create them (i.e. not from corresponding Launcher...).

So my conclusion is that the problem should be solved by figuring out, how to delete widgets in the app that created them, "Open Launcher" in your case. I even would say that this is a bug of that launcher: it doesn't delete its own widgets properly.