title: Android Architecture Component: How to insert repository parameter
body: <p>In a viewmodel class, I've seen sample codes where the constructor takes in a repository as a parameter. Like so:</p>
  
  <p><code>public SampleViewModel(SampleRepository sampleRepository){
      ...
  }
  </code></p>
  
  <p>But in the activity, you use this line to create a viewmodel class <code>ViewModelProviders.of(this).get(SampleViewModel.class)</code>. How do you pass a repository as a parameter to the viewmodel? I also come across mentioning of "dependency injection". Being an inexperience programmer, can anyone advice if DI is related to my question?</p>