Saturday, February 4, 2012

Re: [android-developers] Re: Newly installed widgets are not runnable on Honeycomb

Yes, this changed starting with 3.1:


The end result is:

App widget can't be added to the home screen immediately after the installation.

The application's package needs to be moved from stopped to started state first.

You can do this by providing an activity that the user can launch from Launcher.

This is not the same as the widget config activity.

-- Kostya

4 февраля 2012 г. 5:30 пользователь David Ross <grandpop@vacuumpunk.com> написал:
But that's not how it works in 2.3.x.

Install the "App (Widget)", say from market. Don't run it when given
the "Open" option in the market after download completes. Don't launch
it from the Launcher either. Just navigate back to the Home Screen.

Long press on home screen and select Widgets. Hey presto, it's there!
No need to "launch" the App for it to be available as a Widget. The
Android install process parses the manifest and places the new widget
in the list of available Widgets without having to be "launched"
first.

And while you need to have the configuration Activity in the manifest
and the widget config file, that Activity does not have to do anything
at all really, you can just return RESULT_OKAY and handle the widget
configuration in your WidgetProvider onEnabled() and onUpdate() when
you get the APPWIDGET_xxx Intents. Has that changed in 3.0+? Am I
missing something here?

As I said before, this approach handles the bad use-cases that Android
does not handle cleanly.

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

No comments:

Post a Comment