title: Android ViewModel has no zero argument constructor
body: <p>I am following <a href="https://developer.android.com/topic/libraries/architecture/guide.html" rel="noreferrer">this</a> documentation to learn about LiveData and ViewModel.
  In the doc, the ViewModel class has constructor as such,</p>
  
  <pre><code>public class UserModel extends ViewModel {
    private MutableLiveData&lt;User&gt; user;
  
    @Inject UserModel(MutableLiveData&lt;User&gt; user) {
      this.user = user;
    }
  
    public void init() {
      if (this.user != null) {
        return;
      }
      this.user = new MutableLiveData&lt;&gt;();
    }
  
    public MutableLiveData&lt;User&gt; getUser() {
      return user;
    }
  }
  </code></pre>
  
  <p>However, when I run the code, I get exception:</p>
  
  <pre><code>final UserViewModelviewModel = ViewModelProviders.of(this).get(UserViewModel.class);
  </code></pre>
  
  <blockquote>
    <p>Caused by: java.lang.RuntimeException: Cannot create an instance of class UserViewModel
    Caused by: java.lang.InstantiationException: 
    java.lang.Class
    has no zero argument constructor</p>
  </blockquote>