title: Does ViewModel survive Activity save and restore?
body: <p>Instances of the new <code>ViewModel</code> class can survive configuration changes if used in the following fashion:</p>
  
  <pre><code>mViewModel = ViewModelProviders.of(this).get(MyViewModel.class);
  </code></pre>
  
  <p>However, in addition to configuration changes, there is also a save-restore scenario when the entire application's process is being killed. </p>
  
  <p>Will fields' values inside <code>ViewModel</code> be preserved during save-restore scenario? </p>
  
  <hr>
  
  <p><strong>Edit:</strong> based on the answer to this question, I wrote this article: <a href="https://www.techyourchance.com/android-viewmodel-architecture-component-dangerous/" rel="noreferrer">Android ViewModel Architecture Component is Dangerous</a></p>