Is that possible to make live update
the data of Widget
using Glance
jetpack compose ? Like update data while database is changes . For example while I am using flow
so flow should be able to update the widget data right?
We can update on Click action like :
class MyWidgetActions: ActionCallback {
override suspend fun onRun(context: Context, glanceId: GlanceId, parameters: ActionParameters) {
updateAppWidgetState(context, PreferencesGlanceStateDefinition, glanceId) {
it.toMutablePreferences()
.apply {
...
//toDoSomething()
...
}
}
MyWidget().update(context, glanceId)
...
}
Can we update without on click with flow of data ?