Removing Widget from Home Screen when Uninstalled
When my application is uninstalled, a widget that is contained in this packages stays on the HOME screen and gives an error message "problem loading widget".
How do I remove the widget when my application is uninstalled? Is there an attribute in the manifest that I am missing?
I thought this thing s开发者_JAVA技巧hould be handled by the OS, but guess it is not.
EDITED: I am now catching the "PACKAGE_ REMOVED" intent, and checking the "EXTRA_REPLACING" to make sure it's not a reinstall, but I don't know the actual code to use to actually remove the widget.
You cannot add or remove app widgets from the home screen. Only the user can do that.
Quoting @CommonsWare #4532121
精彩评论