title: Android ViewModel and startActivity
body: <p>I am learning <code>ViewModel</code> and <code>LiveData</code> and, in the process, a doubt arose.</p>
  
  <p>What should I do if I need to start an <code>Activity</code>?</p>
  
  <p>Is it ok to pass the context as a parameter to the <code>ViewModel</code> (the context will not be stored inside the ViewModel)?</p>
  
  <pre><code>ActivityAViewModel : ViewModel() {
      // ...
  
      fun openActivityB(context: Context) {
          context.startActivity(...)
      }
  
      // ...
  }
  
  ActivityA {
      // ...
  
      fun onSomethingHappened() {
          viewModel.openActivityB(this)
      }
  
      // ...
  }
  </code></pre>
  
  <p>If not, what is the most correct thing to do in that case?</p>