I should add that I can create new appwidgets on the homescreen with the 
newest version, but existing widgets don't appear even though the onUpdate 
is called in the AppWidgetProvider.

On Wednesday, June 13, 2012 1:23:31 PM UTC-4, Bryan wrote:
>
> Hi,
>
> I've 2 versions of an app, for which I just merged the code into a single 
> library that I reference from both apps. In testing, I found that if an 
> appwidget existed on the homescreen for this app and I updated to the new 
> version using the library, the LauncherModel.java would delete the widget, 
> logging 
> "Log.e<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3_r1/android/util/Log.java#Log.e%28java.lang.String%2Cjava.lang.String%29>
> (TAG<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.3_r1/com/android/launcher2/LauncherModel.java#LauncherModel.0TAG>
> , "Deleting widget that isn't installed anymore: id=" 
>
> + id + " appWidgetId=" + appWidgetId);". I found that this was due to the 
> change in the AppWidgetProvider in the manifest. It changed to reference the 
> class that moved to the library. To resolve that, I moved the class back out 
> of the library and directly into the project and reverted the manifest for 
> those receivers. This resolved the "deleting widget..." error, but now the 
> widget isn't rendered by the launcher at all after testing the update. I 
> checked /data/system/appwidgets.xml, and the widget is still listed there. 
> The appwidgetprovider is still called and my service runs, pushing the 
> update, but there's no widget on the homescreen. It's not invisible, as I can 
> long press on the area where the widget was and I get the wallpaper choser. 
> Why isn't the widget fully preserved across this updated?
>
> To clarify, my testing procedure is this, on an emulator with API Level 15:
>
> 1. Install version 1 of app
>
> 2. Add a homescreen widget
>
> 3. Update to version 2 of app
>
> 4. Widget remains
> 5. Update to version 3 of app, with code moved to library
>
> 6. Widget is gone, but traces still exist. The appwidgetmanager still 
> recognizes it when calling getAppWidgetIds or getAppWidgetInfo
>
> Any help would be great as I'm getting no information from the logs.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to