More Home Cooking
You will notice that the onHandleIntent() method is almost identical to the
current onUpdate() method in AppWidget. The differences are that all
references to ctxt are replaced with this (since the IntentService is a
Context) and that we need to obtain an AppWidgetManager rather than use one
passed into us. But, since onHandleIntent() is run on a background thread,
we can take as much time as is necessary.
Then, add WidgetService to the manifest:
package="apt.tutorial"
android:versionCode="1"
android:versionName="1.0">
android:label="@string/app_name">
android:resource="@xml/searchable" />
android:value=".LunchList" />
android:label="@string/app_name"
android:icon="@drawable/icon">
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
android:name="android.appwidget.provider"
android:resource="@xml/widget_provider" />
329
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
You will notice that the onHandleIntent() method is almost identical to the
current onUpdate() method in AppWidget. The differences are that all
references to ctxt are replaced with this (since the IntentService is a
Context) and that we need to obtain an AppWidgetManager rather than use one
passed into us. But, since onHandleIntent() is run on a background thread,
we can take as much time as is necessary.
Then, add WidgetService to the manifest:
android:versionCode="1"
android:versionName="1.0">
android:icon="@drawable/icon">
android:resource="@xml/widget_provider" />
329
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
