Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A dynamic shortcut can be used to show a widget on Google Assistant through App Actions by following these steps:

  1. Implement a WidgetProvider in your app to create the widget.
  2. Create a broadcast receiver in your app that receives a custom intent to show the widget.
  3. Create an action in your app's Action catalogue that sends the custom intent to show the widget.
  4. Define the dynamic shortcut in your app's Shortcut catalogue to launch the action that sends the custom intent to show the widget.
  5. In the dynamic shortcut's metadata, add the widget's remote views as an intent extra parameter.
  6. When the user taps the dynamic shortcut in Google Assistant, the action will send the custom intent to your app, which will then show the widget with the remote views received from the intent extra parameter.

Note: App Actions requires Android App Bundle and the App Actions Test Tool to test your implementation.