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
这篇关于卸载时从主屏幕中删除小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:卸载时从主屏幕中删除小部件
基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
