This is a good article for that usecase but there are apps (specially shopping carts) that follow a flow on each page, and that flow has to be stateful.

I recommend using something like Flux architecture to have the state in viewmodel there (like Mobious Library by Spotify).

For each usecase, you have a state in your viewmodel, but the difference with your approach is that the state itself is non-null and also immutable. when actions come from somewhere (like ui), the current state might change (by a usecase) based on the current state, and the change is propagated to the view.

Android Team Lead at Tapsi

Love podcasts or audiobooks? Learn on the go with our new app.