开发者

appWidgetProvider workaround for not enough screen space install failure?

开发者 https://www.devze.com 2023-03-25 10:34 出处:网络
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

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 a开发者_StackOverflowccepted.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号