Listing 103 App Widget implementation Available for

download on import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context;

public class MyAppWidget extends AppWidgetProvider { @Override public void onUpdate(Context context,

AppWidgetManager appWidgetManager, int[] appWidgetIds) { // TODO Update the Widget UI.

Widgets are added to the application manifest much like other Intent Receivers. However, to specify an Intent Receiver as an App Widget you need to add two additional tags to its manifest node (Listing 10-4).

> An Intent Filter for the android.appwidget.action.APPWIDGET_UPDATE action

> A reference to the metadata XML resource that describes your widget

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide

Post a comment