0

Android 3.0 activates widgets differently from 2.x and maybe 4.x

I am trying to figure out how people accomodate this.

Basically on android 2.x the expected functionality is that a widget is downloaded and immediately available for use and the onUpdate method is ready to go to make the widget function as desired/

On Android 3.x it seems that several things don't happen the same way:

  • After a widget is downloaded it isn't always seen in the list of widgets, until after a restart. (I have seen things detailing "why" this happens, but not why other widgets seem to not have this problem)

  • In other cases, a widget is downloaded and is visible in the list of widgets, but added it to the launcher screen doesn't activate it. onUpdate seems not to be working, and touch events are not active, until after a restart.

I have seen posts talking about how a boot loader activates widgets when the launcher screen first loads, but I have seen widgets that don't have this problem.

Similarly, I have used that logic to force the launcher screen to reload by changing the phone's locale. But I would like widgets I create to be available without any troubleshooting, how would this be done?

Thanks

CQM
  • 42,592
  • 75
  • 224
  • 366

1 Answers1

1

For HC+, you have to start any activity associated with the app at least one time after the app is installed, then it should show up in the list. edit: also app on sdcard has issues see http://code.google.com/p/android/issues/detail?id=8555

Edit also yours is a duplicate of App Widget does not appear in the widget list on Honeycomb devices until Launcher is restarted

Community
  • 1
  • 1
logray
  • 2,332
  • 1
  • 29
  • 30
  • thanks that is insightful, what about if you don't have a launcher activity though. No launcher icon, only want a bare minimum widget, is this simply impractical? Is this also the same as what happens on ICS and Jelly Bean – CQM Dec 14 '12 at 19:15
  • @CQM still duplicate questions, read through the duplicate I posted in my answer for all the details. But basically you have to just create a blank dummy activity, just start and then finish right away. – logray Dec 14 '12 at 19:19
  • ah yes, I did read the whole thread on google groups now, insightful. I've used dummy activities before for other hacks, a bit surprised at this outcome but okay. thank you for your responses – CQM Dec 14 '12 at 19:31