appWidgetProvider 屏幕空间不足安装失败的解决方法?
SDK 1.6 问题有解决方法吗?
如果您尝试在空间不足的主屏幕上安装 appWidget,则会调用该小部件的 onUpdate(),调用该小部件的配置活动,尽管该小部件实际上并未安装,但不会回调 onDeleted() 方法允许任何形式的整理。
这个问题在 2.x 中已经修复了吗?我试图查看 Android 问题数据库,但似乎没有类似的缺陷得到修复,而且这个问题还没有被正式报告。
任何帮助都感激地接受。
is there a work-around for SDK 1.6 problem?
If you try to install an appWidget on a home screen with not enough space, the widget's onUpdate() is called, the widget's config activity is called and despite the widget not actually being installed there is no call back to the onDeleted() method to allow any form of tidy up.
Has this been fixed in 2.x? I tried to look at the Android Issue database but it seemed that similar no defects ever get fixed and that this one had not been formally reported.
Any help gratefully accepted.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,我必须维护自己的 appWidgetIds 列表,与 appWidgetManager 的内部列表并行,并干净地处理“幽灵”小部件。在更高版本(2.1+)中,如果小部件由于屏幕空间不足而无法安装,我确实会收到 onDeleted() 调用,但我需要支持 1.6,因此必须处理幽灵小部件。
In the end I had to maintain my own list of appWidgetIds in parallel to the appWidgetManager's internal list and handle "ghost" widgets cleanly. It all works fine in later versions (2.1+) where I do get the onDeleted() call if the Widget fails to install because of lack of screen space, but I needed to support 1.6 and so had to handle to ghost widgets.