Scoping ViewModels in Compose

Lifecycle ViewModel 2.11.0-alpha02 introduces rememberViewModelStoreOwner, an API to scope ViewModelStore directly within the Compose hierarchy. Why It Matters Until now, ViewModelStore scoping was tied to navigation destinations, activities or fragments. There was no clean way to scope a ViewModel to an arbitrary part of your UI (such as a Pager page, a LazyList item, or a custom layout) without building your own ViewModelStoreOwner from scratch. These new APIs close that gap:...

March 11, 2026

Using Compose Beta on AS 4.1

Jetpack Compose hit Beta! Many teams are excited to experiment with Compose, but as you might know, since 1.0.0-alpha04, the compiler has been refactored to a new group and became incompatible with the current Android Studio (AS) 4.1 stable: Compose Version 1.0.0-alpha04 is only compatible with Android Studio 4.2 Canary 13 and later. Been forced to use a Canary version of AS is a real bummer. There are cases in which you want to explore Compose in a real-world application (e....

March 30, 2021