Android Guides | Samples

Android.Appwidget.AppWidgetHost Class

AppWidgetHost provides the interaction with the AppWidget service for apps, like the home screen, that want to embed AppWidgets in their UI.

See Also: AppWidgetHost

Syntax

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

Remarks

AppWidgetHost provides the interaction with the AppWidget service for apps, like the home screen, that want to embed AppWidgets in their UI.

[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.AppWidgetHost are listed below.

See Also: Object

Public Constructors

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

AllocateAppWidgetId() : Int32
Get a appWidgetId for a host in the calling process.
CreateView(Context, Int32, AppWidgetProviderInfo) : AppWidgetHostView
Create the AppWidgetHostView for the given widget.
static
DeleteAllHosts()
Remove all records about all hosts for your package.
DeleteAppWidgetId(Int32)
Stop listening to changes for this AppWidget.
DeleteHost()
Remove all records about this host from the AppWidget manager.
StartAppWidgetConfigureActivityForResult(Activity, Int32, ActivityFlags, Int32, Bundle)
Starts an app widget provider configure activity for result on behalf of the caller.
StartListening()
Start receiving onAppWidgetChanged calls for your AppWidgets.
StopListening()
Stop receiving onAppWidgetChanged calls for your AppWidgets.

Protected Methods

ClearViews()
Clear the list of Views that have been created by this AppWidgetHost.
OnCreateView(Context, Int32, AppWidgetProviderInfo) : AppWidgetHostView
Called to create the AppWidgetHostView.
OnProviderChanged(Int32, AppWidgetProviderInfo)
Called when the AppWidget provider for a AppWidget has been upgraded to a new apk.
OnProvidersChanged()
Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.