Some confusions about Androids App-Widgets
I'm currently playing around with App Widgets in Android and I'm a little confused about the appWidgetsIds
-parameter in the AppWidgetProvider
s onUpdate
-method.
The Docs say:
appWidgetIds: The appWidgetIds for which an update is needed. Note that this may be all of the AppWidget instances for this provider, or just a subset of them.
So I suggested that if I have two instances of my Wid开发者_开发问答get on the Home-Screen, there would be two ID's in the Array. So I added two instances of it but the array contains eight elements.
There are no other Widgets on the Home-Screen.
Am I missing something here or is this a Android Bug?
Up to and including Android 1.6 widgets which fail to get added to the home screen are still in the list. I call them "phantom widgets". They get created when you try to add a widget but there's not enough space and you will get a message about that. But the widget somehow still makes it to the internal list. I think this was supposed to be fixed with 2.0 but I'm not sure.
Okay, after clearing all the Apps Data and completely reinstalling it, it now works.
So, I'm not sure what the problem was, I only know it's solved now.
精彩评论