6

I have an AppWidgetProvider under package "com.developer.application"

I tried moving this AppWidgetProvider under package "com.developer.application.widgets" Upon doing so I updated all references in the AndroidManifest to accommodate the move.

After uploading the changes to the device, the widgets (associated with the aforementioned AppWidgetProvider) that were currently on the home screen break and just forever show the "Loading" graphic.

I know nothing is wrong with my pointers/package paths because if I re-add the widget to the home screen everything works fine.

So simply put, moving an AppWidgetProvider to a different package and updating all necessary references still breaks the active home screen widget(s).

Any ideas? Thank you!

Matt.

Matt M
  • 814
  • 11
  • 23
  • This question give me a "light at end of the tunnel" for a weird problem I faced when I was making a widget in Xamarin.Android project. There was an update from Xamarin.Android 10.1 or previous to 10.2 or later where they changed the auto generated package name for classes. And causes the issue you declared in the question. Thank you ;) – Mohammad Sayed Nov 26 '20 at 18:06

1 Answers1

5

I've also experienced that.

My guess is that the launcher saves the class name of the widget (including package name), so it just breaks when you change it.

Ran
  • 4,117
  • 4
  • 44
  • 70
  • As this does make sense I'll accept this answer. Would be nice to know of any possible fix/workaround if anyone has suggestions :) – Matt M Jun 23 '12 at 20:32
  • I couldn't find any workaround. Maybe if you leave a "dummy" class in the old package and make it extend the class in the new package. – Ran Jun 24 '12 at 11:03
  • Thanks!! 7 years later and i'm having the same issue. Must be a "feature" i guess. ;-) Has anyone found a solution? – einUsername Sep 24 '19 at 14:57
  • It is correct, there is no way to fix it, unfortunately. If you want to know why this is happening, I wrote a detailed [blog post](https://arkadiuszchmura.com/posts/do-not-change-the-package-name-or-class-name-of-your-app-widget-provider/) about this problem. – CloudJR Feb 22 '22 at 06:53