Hi, maybe someone can help in this channel? Google...
# glance
p
Hi, maybe someone can help in this channel? Google recommends to use CoroutineWorker to update our new Glance widgets, I suposse that using a periodic work started in Application when the app is started for the first time, for example, because now, widgets doesn't have onEnabled() method, that in oldschool widgets was used to start periodic threads for updating them. So I see a problem here. If the user has not placed any widget on the desktop, why should we have to start a periodic worker constantly updating? Do google offers a solution for this? I don't find it.
t
The
GlanceAppWidgetReceiver
has an
onEnabled
function you can override.
c
Also, there is no „oldschool“ widget. Glance is just a UI wrapper for you to be able to use compose to create your widgets. It still the same API underneath that layer.
p
great, thank you, I didn't notice that GlanceAppWidgetReceiver had that method, and the glance guide is not too much expanded and didn't mentioned it
🙌 1
now seems to work