title: ViewModel in DialogFragment
body: <p>I am trying to change this class to work with my room query </p>
  
  <pre><code>@Query("select * from customer_contacts where serverCustomerId = :id and contactName like '%' || :name || '%'")
  fun fetchCustomerContactsByName(id:Int, name:String): LiveData&lt;List&lt;CustomerContact&gt;&gt;
  </code></pre>
  
  <p>and my view model </p>
  
  <pre><code>class CustomerContactVM : ViewModel() {
  var customers: LiveData&lt;List&lt;CustomerContact&gt;&gt; = MutableLiveData&lt;List&lt;CustomerContact&gt;&gt;()
  
  fun getCustomerContacts(id: Int, name: String) {
      customers = CustomerContactDao().fetchCustomerContactsByName(id, name)
  }
  }
  </code></pre>
  
  <p>I dont understand how to create the viewmodel in the dialog fragment as I keep getting cannot resolve errors trying ViewModelProviders.of(this).get(CustomerContactVM.class)</p>
  
  <pre><code>public class CustomerContactListFragment extends DialogFragment {
  
  private CustomerContactVM customerContactVM;
  
  @Override
  public void onStart() {
      super.onStart();
      //setEmptyText("No Items");
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      if (savedInstanceState != null) { mCustomer = savedInstanceState.getString(ARG_CUSTOMER);
          if (savedInstanceState.getString(ARG_QUERY) != null) {
              mQuery = savedInstanceState.getString(ARG_QUERY);
          }
      }
  
      GlobalState globalState = (GlobalState) getActivity().getApplication();
     // mState.addScreenLog("CustomerContactListFragment");
  
      return inflater.inflate(R.layout.fragment_catalogue_items, container, false);
  }
  }
  
  @Override
  public void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
  }
  
  
  @Override
  public void onAttach(Activity activity) {
      super.onAttach(activity);
  }
  
  @Override
  public void onDetach() {
      dbHelper.close();
      super.onDetach();
  }
  
  
  }
  </code></pre>