title: How to update the custom value in a view model object
body: <p>I'm trying to create a menu setting that will update the value passed into a ViewModelFactory and return a new list of that size. </p>
  
  <p>I've tried passing the value and calling ViewModelFactory again, but the list size doesn't update.</p>
  
  <pre><code>    factory = new WordViewModelFactory(getApplication(), listSize);
  
      viewModel = ViewModelProviders.of(this, factory).get(WordViewModel.class);
  
      ((WordViewModel) viewModel).getWordList().observe(this, new Observer&lt;List&lt;Word&gt;&gt;() {
          @Override
          public void onChanged(@Nullable List&lt;Word&gt; words) {
             Log.d("Shawn", words.toString());
              rvadapter.setWord(words);
          }
      });
  </code></pre>
  
  <p>Menu selection</p>
  
  <pre><code>    @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.menu_display_3:
                  menuSelection(3);
                  return true;
              case R.id.menu_display_5:
                  menuSelection(5);
                  return true;
              case R.id.menu_object_info:
                  Log.d("Shawn", viewModel.toString());
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
      }
  
      private void menuSelection(int listSize) {
          Log.d("Shawn", "menuSelection num = " + listSize);
  
      }
  </code></pre>
  
  <p>ViewModel</p>
  
  <pre><code>    private Repository repository;
      private LiveData&lt;List&lt;Word&gt;&gt; wordList;
  
      public WordViewModel(Application application, int listSize) {
          super(application);
          repository = new Repository(application, listSize);
          wordList = repository.getWordList();
      }
  
      public LiveData&lt;List&lt;Word&gt;&gt; getWordList() {
          return wordList;
      }
  
      public LiveData&lt;List&lt;Word&gt;&gt; updateList(int newListSize) {
  
          return wordList.postValue(newListSize);
      }
  </code></pre>
  
  <p>Repository</p>
  
  <pre><code>    private Repository repository;
      private LiveData&lt;List&lt;Word&gt;&gt; wordList;
  
  
      public WordViewModel(Application application, int listSize) {
          super(application);
          repository = new Repository(application, listSize);
          wordList = repository.getWordList();
      }
  
      public LiveData&lt;List&lt;Word&gt;&gt; getWordList() {
          return wordList;
      }
  
  </code></pre>
  
  <p>DAO</p>
  
  <pre><code>    @Query("SELECT * FROM word_table ORDER BY word ASC LIMIT :size")
      LiveData&lt;List&lt;Word&gt;&gt; getAllNotes(int size);
  </code></pre>