title: Update all fragments data at the same time with ViewModel
body: <p>I have 12 fragments <code>UpcomingGamesFragment</code> repeated twelve times for each month of the year, the respective fragment shows the game releases of the month. For example, the first month will show the games releasing in January 2019, the next fragment will have February 2019 releases, etc. </p>
  
  <p>What I'm trying to build is an architecture that uses a <code>ViewModel</code>. A <code>ViewModel</code> which will be shared across all my 12 fragments and would trigger the data change (through LiveData) to all fragments gracefully, but I have no idea how to use this <code>ViewModel</code> class to accomplish the update to all visible fragments, here's my <code>UpcomingGamesFragment</code> class with the request month data method:</p>
  
  <pre><code>public class UpcomingGamesFragment extends Fragment {
  
  public void loadReleaseData(final int refresh) {
      if (mDatabaseLoading == null) {
          Log.d(TAG, "Fragment filter " + mFilter + " [fragment is null]");
          return;
      } else {
          Log.d(TAG, "Updating fragment: " + mFilter);
      }
  
      if (AppUtil.doesInternetWork(getActivity())) {
          // update, data fetched from firebase 
      }
  }
  </code></pre>
  
  <p>The 12 fragments are initialized in another fragment which gets shown in <code>MainActivity</code>, the fragment is called <code>UpcomingViewPagerFragment</code> which creates 12 <code>UpcomingGamesFragment</code> in a loop.</p>
  
  <p>And here's my <code>ViewModel</code> class: </p>
  
  <pre><code>public class ReleasesViewModel extends ViewModel {
  private MutableLiveData&lt;List&lt;_Release&gt;&gt; upcomingFragmentLiveData =
          new MutableLiveData&lt;&gt;();
  
  public ReleasesViewModel() {
  
  }
  
  public LiveData&lt;List&lt;_Release&gt;&gt; getUpcomingFragmentList() {
      return upcomingFragmentLiveData;
  }
  }
  </code></pre>
  
  <p>So how can I update the 12 fragments with the <code>loadReleaseData</code> method taking in count the lifecycle of each? </p>