Learning Android Development

Managing Compose State Variable With And Without ViewModel

Decide where can you put your Compose State variable

Photo by Jake Young on Unsplash

In Jetpack Compose, the way we update the UI is by updating the State Variable. But where should we put the Compose State Variable? How can we get it to survive per state restoration?

--

--

--

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Recommended from Medium

Sealed Classes Unit Tests💥

Android Kotlin Developer Nanodegree Projects Review

Fun with Text to Image in Android

How to Use Git in Android Studio — Part 2

Create A SafeMutableLiveData That Is Non-Nullable

How Do You Set a Flutter Target File Based On Android Product Flavors?

Expert: Xamarin Android Weather App Highlights Ads & Analytics Kit

Adding a camera shake effect

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Elye

Elye

Sharing Software Development Experience, focus on Mobile. https://elye-project.medium.com/subscribe https://twitter.com/elye_project

More from Medium

Saving StateFlow State in ViewModel

Sending View Model Events to the UI

Collect Kotlin’s Flow Lifecycle Aware With Style

An image of a waterfall.

Getting Started with ConstraintLayout in Jetpack Compose