My widget has a progress wheel on it, which is invisible by default, and whenever my service is run to do some task on the widget, it starts out by setting that wheel to visible, then calling the updateAppWidget with the remoteview containing this change.
I then go on to doing all the stuff i need to do, and at the end, in the new remoteview, i set it to invisible again, and once more call updateAppWidget.
I have tested this in the emulator on android 2.2, and on my sisters htc wildfire with 2.2.1. Both makes the widget fail(the emulator says “Problem loading widget”, while the wildfire says something “Søg” in danish, since the language is set to danish, which even so is weird that is would say “Søg” since that means “Search”), whenever its supposed to display the wheel (tried to remove only the code that works the wheel, and it worked as expected then.
The weird thing is that in android 2.3, which i have on my nexus one, it works perfectly fine. Everything as expected(Also on a 2.3 emulator). The widget i’m making is build towards 2.2.
I have tried to search but have been unable to find anyone else with this issue. Is the progressbar not supported on appwidgets in 2.2 or what? I’m at a loss as to what to do :S
It is a known bug which occurs if you try to change the visibility of a ProgressBar through a RemoteViews object.
Solution: wrap the progress bar in a Layout and use setViewVisibility() to make the Layout invisible/gone instead of the progress bar.
Sources: Official issue & Bug details