Enable users to configure app widgets

App widgets can be configurable. For example, a clock widget can let users configure which time zone to display.

If you want to let users configure your widget’s settings, create a widget configuration Activity.

Declare the configuration activity

Declaring the configuration activity in the manifest and linking it inside your provider XML metadata is identical across both Views-based and Glance-based app widgets.

To learn how to declare the configuration activity, see the Compose-first Declare the configuration activity section in the Glance configuration documentation.

Implement the configuration activity

Because configuration activities are standard components called by the platform launcher, their basic lifecycle callbacks must follow the system's return value rules.

To learn how to implement a configuration activity, check the Compose-first Implement the configuration activity section in the Glance documentation.

Update the widget from the configuration activity

In traditional Views-based widgets, you update the widget upon configuration completion using the AppWidgetManager and a RemoteViews layout instance.

If you are building a legacy Views-based widget and need to update the RemoteViews layout, reference the traditional Views Update sample code on GitHub. For modern Compose-first widgets, see the Update from the configuration activity section in the Glance documentation.

Widget configuration options

Widget behaviors (such as allowing reconfiguration later or skipping initial configuration setup steps altogether) are registered inside metadata attributes using standard Android 12 flags.

To learn how to leverage dynamic widget options, see the Compose-first Widget configuration options section in the Glance configuration documentation.

Enable users to reconfigure placed widgets

To understand how to add custom reconfigurable setup triggers, see the Compose-first Enable users to reconfigure placed widgets section in the Glance documentation.

Use the widget's default configuration

To learn how to skip configuration setups by default, see the Compose-first Use the widget's default configuration section in the Glance documentation.