Android Guides | Samples

Android.Appwidget.AppWidgetProvider Class

A convenience class to aid in implementing an AppWidget provider.

See Also: AppWidgetProvider

Syntax

[Android.Runtime.Register("android/appwidget/AppWidgetProvider", DoNotGenerateAcw=true)]
public class AppWidgetProvider : BroadcastReceiver

Remarks

A convenience class to aid in implementing an AppWidget provider. Everything you can do with AppWidgetProvider, you can do with a regular BroadcastReceiver. AppWidgetProvider merely parses the relevant fields out of the Intent that is received in AppWidgetProvider.OnReceive(Context,Intent), and calls hook methods with the received extras.

Developer Guides

Extend this class and override one or more of the AppWidgetProvider.OnUpdate(Context,AppWidgetManager,AppWidgetManager), AppWidgetProvider.OnDeleted(Context,Int32[]), AppWidgetProvider.OnEnabled(Context) or AppWidgetProvider.OnDisabled(Context) methods to implement your own AppWidget functionality.

For more information about how to write an app widget provider, read the App Widgets developer guide.

[Android Documentation]

Requirements

Namespace: Android.Appwidget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3

The members of Android.Appwidget.AppWidgetProvider are listed below.

See Also: BroadcastReceiver

Public Constructors

Constructor to initialize AppWidgetProvider.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

OnAppWidgetOptionsChanged(Context, AppWidgetManager, Int32, Bundle)
Called in response to the AppWidgetManager.ActionAppwidgetOptionsChanged broadcast when this widget has been layed out at a new size.
OnDeleted(Context, Int32[])
Called in response to the AppWidgetManager.ActionAppwidgetDeleted broadcast when one or more AppWidget instances have been deleted.
OnDisabled(Context)
Called in response to the AppWidgetManager.ActionAppwidgetDisabled broadcast, which is sent when the last AppWidget instance for this provider is deleted.
OnEnabled(Context)
Called in response to the AppWidgetManager.ActionAppwidgetEnabled broadcast when the a AppWidget for this provider is instantiated.
override
OnReceive(Context, Intent)
Implements BroadcastReceiver.OnReceive(Context,Intent) to dispatch calls to the various other methods on AppWidgetProvider.
OnRestored(Context, Int32[], Int32[])
Called in response to the AppWidgetManager.ActionAppwidgetRestored broadcast when instances of this AppWidget provider have been restored from backup.
OnUpdate(Context, AppWidgetManager, Int32[])
Called in response to the AppWidgetManager.ActionAppwidgetUpdate and AppWidgetManager.ActionAppwidgetRestored broadcasts when this AppWidget provider is being asked to provide RemoteViews for a set of AppWidgets.