title: call MutableLiveData web service agine to update the list
body: <p>I use MVVM structure in my project. 
  I have the main fragment with list observed a web service as you can see in the code</p>
  
  <p>fragment :</p>
  
  <pre><code>mViewModel.getHomePageList().observe(this, homeDataWrapper -&gt; {
             if (homeDataWrapper!=null) {
                 if (homeDataWrapper.isStatus()) {
                     binding.homeProgressBar.setVisibility(View.INVISIBLE);
                     ToastUtil.showTosat(homeDataWrapper.getData().getMessage(), getContext());
                     Log.d(TAG, "onChanged: ");
                 }
             }
         });
  </code></pre>
  
  <p>view model:</p>
  
  <pre><code>ublic class HomePageViewModel extends AndroidViewModel {
      private MutableLiveData&lt;DataWrapper&lt;Home&gt;&gt; data;
      public ObservableInt loading;
      private HomeRepository homeRepository;
      private HomePageAdapter adapter;
  
      public HomePageViewModel(@NonNull Application application) {
          super(application);
      }
  
      public void init() {
          adapter = new HomePageAdapter(R.layout.main_page_list, this);
          homeRepository = new HomeRepository();
          if (this.data != null) {
              // ViewModel is created per Fragment so
              // we know the userId won't change
              return;
          }
          data = homeRepository.getHomeScreen();
  
      }
  
  
      public HomePageAdapter getAdapter() {
          return adapter;
      }
  
      public void onItemClick(Integer index) {
  
      }
  
      public void onSerachClicked(View view) {
          Navigation.findNavController(view).navigate(R.id.action_homePageFragment_to_searchActivity);
      }
  
  
  
      public MutableLiveData&lt;DataWrapper&lt;Home&gt;&gt; getHomePageList() {
          return this.data;
      }
  
  }
  </code></pre>
  
  <p>HomeRepository :</p>
  
  <pre><code>public MutableLiveData&lt;DataWrapper&lt;Home&gt;&gt; getHomeScreen() {
      final MutableLiveData&lt;DataWrapper&lt;Home&gt;&gt; homeMutableLiveData = new MutableLiveData&lt;&gt;();
      final DataWrapper&lt;Home&gt; dataWrapper = new DataWrapper&lt;&gt;();
      RetrofitInstance.getApiService().getHome().enqueue(new Callback&lt;Home&gt;() {
          @Override
          public void onResponse(@NotNull Call&lt;Home&gt; call, @NotNull Response&lt;Home&gt; response) {
              Log.d("", "onResponse: " + response);
              if (response.code() == 200) {
                  dataWrapper.setData(response.body());
                  dataWrapper.setStatus(true);
                  homeMutableLiveData.postValue(dataWrapper);
              }
  
          }
  
          @Override
          public void onFailure(Call&lt;Home&gt; call, Throwable t) {
              Log.d("", "onResponse: " + t);
              dataWrapper.setApiException((Exception) t);
              dataWrapper.setStatus(false);
              homeMutableLiveData.postValue(dataWrapper);
          }
      });
  
      return homeMutableLiveData;
  }
  </code></pre>
  
  <p>I would like to add SwipeRefreshLayout to update the main list. what is the correct way to call the web service again and update the list?
  can anyone help me?</p>