Stay organized with collections
Save and categorize content based on your preferences.
Contains the components necessary to create "app widgets", which users can embed in other
applications (such as the home screen) to quickly access application data and services without
launching a new activity.
For more information, see the
App Widgets guide.
The behavior of an app widget is published by an "app widget provider." An "app widget host" is
a component that can contain app widgets (such as the Home screen).
Any application can publish app widgets (as an app widget provider). All an application needs to
do to publish an app widget is
provide a BroadcastReceiver
that receives the ACTION_APPWIDGET_UPDATE
intent
and provide some metadata about the app widget. Android provides the
AppWidgetProvider
class, which extends BroadcastReceiver
, as a convenience class to define the app widget behavior and aid
in handling the broadcasts.
App widget hosts are the containers in which widgets can be placed. Most of the look and feel
details are left up to the widget hosts. For example, the home screen has one way of viewing
widgets, but the lock screen could also contain widgets, and it would have a different way of
adding, removing and otherwise managing widgets.
For information about implementing an app widget host, see the AppWidgetHost
class.
Classes
AppWidgetEvent |
An immutable class that describes the event data for an app widget interaction event.
|
AppWidgetHost |
AppWidgetHost provides the interaction with the AppWidget service for apps,
like the home screen, that want to embed AppWidgets in their UI.
|
AppWidgetHostView |
Provides the glue to show AppWidget views.
|
AppWidgetManager |
Updates AppWidget state; gets information about installed AppWidget providers and other
AppWidget related state.
|
AppWidgetProvider |
A convenience class to aid in implementing an AppWidget provider.
|
AppWidgetProviderInfo |
Describes the meta data for an installed AppWidget provider.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[],[],null,["# android.appwidget\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nandroid.appwidget\n=================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/appwidget/package-summary \"View this page in Kotlin\") \\|Java\n\nContains the components necessary to create \"app widgets\", which users can embed in other\napplications (such as the home screen) to quickly access application data and services without\nlaunching a new activity.\n\nFor more information, see the\n[App Widgets](/guide/topics/appwidgets) guide.\n\n\nThe behavior of an app widget is published by an \"app widget provider.\" An \"app widget host\" is\na component that can contain app widgets (such as the Home screen).\n\nAny application can publish app widgets (as an app widget provider). All an application needs to\ndo to publish an app widget is\nprovide a [BroadcastReceiver](/reference/android/content/BroadcastReceiver) that receives the [ACTION_APPWIDGET_UPDATE](/reference/android/appwidget/AppWidgetManager#ACTION_APPWIDGET_UPDATE) intent\nand provide some metadata about the app widget. Android provides the\n[AppWidgetProvider](/reference/android/appwidget/AppWidgetProvider) class, which extends [BroadcastReceiver](/reference/android/content/BroadcastReceiver), as a convenience class to define the app widget behavior and aid\nin handling the broadcasts.\n\nApp widget hosts are the containers in which widgets can be placed. Most of the look and feel\ndetails are left up to the widget hosts. For example, the home screen has one way of viewing\nwidgets, but the lock screen could also contain widgets, and it would have a different way of\nadding, removing and otherwise managing widgets.\n\nFor information about implementing an app widget host, see the [AppWidgetHost](/reference/android/appwidget/AppWidgetHost) class.\n\nClasses\n-------\n\n|-----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [AppWidgetEvent](/reference/android/appwidget/AppWidgetEvent) | An immutable class that describes the event data for an app widget interaction event. |\n| [AppWidgetHost](/reference/android/appwidget/AppWidgetHost) | AppWidgetHost provides the interaction with the AppWidget service for apps, like the home screen, that want to embed AppWidgets in their UI. |\n| [AppWidgetHostView](/reference/android/appwidget/AppWidgetHostView) | Provides the glue to show AppWidget views. |\n| [AppWidgetManager](/reference/android/appwidget/AppWidgetManager) | Updates AppWidget state; gets information about installed AppWidget providers and other AppWidget related state. |\n| [AppWidgetProvider](/reference/android/appwidget/AppWidgetProvider) | A convenience class to aid in implementing an AppWidget provider. |\n| [AppWidgetProviderInfo](/reference/android/appwidget/AppWidgetProviderInfo) | Describes the meta data for an installed AppWidget provider. |\n\n-\n\n Classes\n -------\n\n - [AppWidgetEvent](/reference/android/appwidget/AppWidgetEvent)\n - [AppWidgetHost](/reference/android/appwidget/AppWidgetHost)\n - [AppWidgetHostView](/reference/android/appwidget/AppWidgetHostView)\n - [AppWidgetManager](/reference/android/appwidget/AppWidgetManager)\n - [AppWidgetProvider](/reference/android/appwidget/AppWidgetProvider)\n - [AppWidgetProviderInfo](/reference/android/appwidget/AppWidgetProviderInfo)"]]