GlanceAppWidgetReceiver
public abstract class GlanceAppWidgetReceiver : AppWidgetProvider()
AppWidgetProvider
using the given GlanceAppWidget
to generate the remote views when needed.
This should typically used as: class MyGlanceAppWidgetProvider : GlanceAppWidgetProvider() { override val glanceAppWidget: GlanceAppWidget() get() = MyGlanceAppWidget() }
Note: If you override any of the AppWidgetProvider
methods, ensure you call their super-class
implementation.
Important: if you override any of the methods of this class, you must call the super
implementation, and you must not call AppWidgetProvider.goAsync
, as it will be called by the
super implementation. This means your processing time must be short.
Companion Object
Properties
public const val ACTION_DEBUG_UPDATE: String
Action for a broadcast intent that will try to update all instances of a Glance App Widget for debugging.
adb shell am broadcast -a androidx.glance.appwidget.action.DEBUG_UPDATE -n APP/COMPONENT
where APP/COMPONENT is the manifest component for the GlanceAppWidgetReceiver subclass. This only works if the Receiver is exported (or the target device has adb running as root), and has androidx.glance.appwidget.DEBUG_UPDATE in its intent-filter. This should only be done for debug builds and disabled for release.