In an Android app, Kotlin flows are typically collected from the UI layer to display data updates on the screen. However, you want to collect these flows making sure you’re not doing more work than necessary, wasting resources (both CPU and memory) or leaking data when the view goes to the background. In this article, you’ll learn how the Lifecycle.repeatOnLifecycle, and Flow.flowWithLifecycle API

