So question #2: I have a widget that is showing a ...
# glance
i
So question #2: I have a widget that is showing a progress bar and a timer, showing how long left for something, meant to be on the lock screen eventually (think something like your taxi or delivery app showing how far away the driver is for example, though my case is simpler as it simply depends on the current time). Rest in the thread: -->
My problem is that the glance session worker just stops the recomposition at some point, saying
Copy code
Worker result SUCCESS for Work [ id=..., tags={ androidx.glance.session.SessionWorker } ]
Digging in the code, i see it has these unconfigurable timeout values:
Copy code
internal data class TimeoutOptions(
    val initialTimeout: Duration = 45.seconds,
    val additionalTime: Duration = 5.seconds,
    val idleTimeout: Duration = 5.seconds,
    val timeSource: TimeSource = TimeSource.Monotonic,
)
So how do i get around these? I’m assuming i should trigger an update for the widget periodically from the main app using a coroutine worker?
s
Yes, you periodically update your widget using a worker.