'In Android, Glance widgets are "flickering" during every update (even if there is no content change)

I'm not sure if this is a problem with Glance still being in alpha, or if I'm doing something wrong. But every time the widget receiver's onUpdate() is triggered, it's being completely re-composed. It resets to the initialLayout for a second, and then re-composes to the correct state.

The problem is that it happens even if there is no change in the widget state, so it just "flickers" like that every time there's a widget update, and it looks really bad.

I've already implemented manual updates using MyWidget().updateIf<Preferences>, so that my app only updates the widget when the state changes, but there are still automatic updates that the OS is doing, so the "flickering" is still happening.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source