Removing Widget from Home Screen when Uninstalled(卸载时从主屏幕中删除小部件)
问题描述
当我的应用程序被卸载时,包含在这个包中的一个小部件会留在 HOME屏幕并给出错误消息加载小部件问题".
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 should be handled by the OS, but guess it is not.
已编辑:我现在正在捕捉PACKAGE_REMOVED"意图,并检查EXTRA_REPLACING"以确保它不是重新安装,但我不知道实际使用的实际代码删除小部件.
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.
引用@CommonsWare #4532121
Quoting @CommonsWare #4532121
这篇关于卸载时从主屏幕中删除小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:卸载时从主屏幕中删除小部件


基础教程推荐
- Android文本颜色不会改变颜色 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01