title: Best practice for Android MVVM startActivity
body: <p>I am building an Android App using MVVM and DataBinding. And I have a function inside my ViewModel that starts an Activity.
  Is it okay to have an onClick call inside a ViewModel?</p>
  
  <p>Like this.</p>
  
  <pre><code>public class MyViewModel {
      public void onClick(View view, long productId) {
          Context context = view.getContext();
          Intent intent = new Intent(context, ProductDetailActivity.class);
          intent.putExtra("productId", productId);
          context.startActivity(intent);
      }
  }
  </code></pre>
  
  <p>And in my XML:</p>
  
  <pre><code>...
  android:onClick="@{(v) -&gt; viewModel.onClick(v, viewModel.product.id)}"&gt;
  </code></pre>
  
  <p>Or would it be a best practice to move it to the View and call it from EventBus or Rx and have only POJO in my ViewModel?</p>