title: AndroidViewModel vs passing Application context to ViewModel
body: <p>The <a href="https://developer.android.com/topic/libraries/architecture/viewmodel" rel="nofollow noreferrer">documentation</a> states the following:</p>
  
  <blockquote>
    <p>If the ViewModel needs the Application context, for example to find a system service, it can extend the AndroidViewModel class and have a constructor that receives the Application in the constructor, since Application class extends Context.</p>
  </blockquote>
  
  <p>Code example:</p>
  
  <pre><code>class MainViewModel(application: Application) : AndroidViewModel(application) {
  ... 
  }
  </code></pre>
  
  <p>Two questions:</p>
  
  <ol>
  <li>How does the AndroidViewModel helps me if I need to pass <code>Application</code> to ViewModel's ctor anyway?</li>
  <li>And again, if I need to pass <code>Application</code>, why do I need AndroidViewModel? I can just use ViewModel and pass it <code>Application</code>.</li>
  </ol>