卸载时从主屏幕中删除小部件

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

这篇关于卸载时从主屏幕中删除小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)