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

2023-09-08移动开发问题
102

本文介绍了卸载时从主屏幕中删除小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

当我的应用程序被卸载时,包含在这个包中的一个小部件会留在 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

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

The End

相关推荐

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?
How can i use MYSQL database connection in iphone application useing cocos2d?(如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?)...
2024-08-12 移动开发问题
5

在 cocos2d 中平滑拖动一个 Sprite - iPhone
Smoothly drag a Sprite in cocos2d - iPhone(在 cocos2d 中平滑拖动一个 Sprite - iPhone)...
2024-08-12 移动开发问题
10

CCScrollView 滚动和触摸事件永远不会触发
CCScrollView scroll and touch events never firing(CCScrollView 滚动和触摸事件永远不会触发)...
2024-08-12 移动开发问题
1

使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘
removing jagged edges of my ropes using antialiasing of OpenGLES(使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘)...
2024-08-12 移动开发问题
34

cocos2d 在场景之间移动
cocos2d Moving between scene(cocos2d 在场景之间移动)...
2024-08-12 移动开发问题
2