android5-3 Exercise 3: WhileSubscribed and init ============================================ Rotation: the UI collector goes away briefly and a new one arrives within 5 seconds, so the upstream flow keeps running and the state is not rebuilt from scratch (docs: this is the recommended policy for data arriving as a stream). Home and wait a minute: with collectAsStateWithLifecycle the UI stops collecting when it falls below STARTED (docs); after the 5-second timeout the upstream stops; when the user returns, collection restarts and the state is rebuilt from the data layer. (Details of the stop and restart are general knowledge.) Why not load from init: the docs advise against launching asynchronous operations in the init block or constructor. A reasonable explanation (general knowledge): the work starts whether or not anything shows the result, it is harder to test, and it cannot be tied to whether the UI is actually listening. Building the state from a Flow with stateIn starts the work only when something collects it. Code unrun.