Reputation: 1010
I am working to make Launcher Application. I have created some temporary widgets for some purpose in my home screens. Now I want to remove that widgets from screen without drag and drop. So I want to know that it is possible or not ? And if possible then give some hint. I am also happy if i can remove widget on click of itself widget.
I have tried this but not working for me appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
Upvotes: 4
Views: 1950
Reputation: 4091
Take a look at this question. It appears that this isn't possible: I guess to prevent changing a user's setup without explicit permission.
On the same page it shares why your current method does not work:
Unfortunately, that does not work because deleteAppWidgetId() does not remove the widget from the home screen but just stops listening to changes for this AppWidget
Upvotes: 2