Ian Lake
1 min readMay 20, 2017

--

You are correct: the ViewModel is destroyed if your process is killed by Android. Just like before, you should use onSaveInstanceState() to store any data you must have to later recreate your Activity in the same state as before.

Of course, most of what you need to create your UI should come from persistent storage sources, such as a disk cache or Room. Those would fulfill the ‘repository’ role in the Guide to App Architecture.

--

--