Вопрос

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top