title: AutocompleteTextView with room
body: <p>I have a Room db and have created a model and viewModel. I was wondering how to make an autocompletetextview work with the database data and the viewmodel to filter the customer list as the user types</p>
  
  <p>ViewModel</p>
  
  <pre><code>class CustomerVM : ViewModel() {
      private val customers: MutableLiveData&lt;List&lt;Customer&gt;&gt; by lazy {
          loadCustomers()
      }
  
      fun getCustomers(): LiveData&lt;List&lt;Customer&gt;&gt; {
          return customers
      }
  
      private fun loadCustomers() : MutableLiveData&lt;List&lt;Customer&gt;&gt; {
          return DataModel.getInstance().roomDb.CustomerDao().getAllCustomers() as MutableLiveData&lt;List&lt;Customer&gt;&gt;
      }
  }
  </code></pre>