title: Keep 'distant' Fragments updated and ready for users in a ViewPager
body: <p>I have a couple of <code>Fragment</code>s with <code>RecyclerView</code>s in a <code>ViewPager</code>. On actions in the first <code>Fragment</code>, the remaining <code>Fragment</code>s change what they display. </p>
  
  <p>I can access all the <code>Fragment</code>s from the first one and call update methods on them. The problem is, the updates do not happen if I do not swipe to the other <code>Fragment</code>s. In fact, before tapping any action buttons in the first <code>Fragment</code>, I have to swipe to the other <code>Fragment</code>s (without purpose) just to keep the app from crashing with a <code>NullPointerException</code>. </p>
  
  <p>The reason I guess is because the remaining <code>Fragment</code>s are <code>null</code> as they are not brought into view.</p>
  
  <p>I have tried this approach so far, in vain: </p>
  
  <pre><code>public void updatePager(int pagePosition)
  {
      ((NMMain) getActivity()).dsFragment.updateDSFragment(dView);
  
      nMParentViewPager = (ViewPager) getActivity().findViewById(R.id.gsSupremePager);
      nMParentViewPager.getAdapter().notifyDataSetChanged();
      nMParentViewPager.setCurrentItem(pagePosition, true);
  } // of updatePager()
  </code></pre>
  
  <p><strong><code>Log</code></strong></p>
  
  <p>After clicking action buttons in Fragment1 <strong><em>after swiping to fragments</em></strong>:</p>
  
  <p><code>02-06 14:53:21.563 7765-8678/com.my A/NMDBHelper class: Create View-1 query: CREATE VIEW View_Temp 02-06 14:53:21.585 7765-8678/com.my A/NMDBHelper class: Create dealsView-2 query: CREATE TABLE D_View 02-06 14:53:21.748 7765-7765/com.my 
  E/DSFragment: In frag2.updateFragment(): dView.size() = 3</code></p>
  
  <p>After clicking action buttons in Fragment1 <strong><em>without swiping to any fragments</em></strong>:</p>
  
  <p><code>02-06 14:58:52.691 11967-11967/com.nearme E/AndroidRuntime: FATAL EXCEPTION: main Process: com.my, PID: 11967 java.lang.NullPointerException at com.my.s.Frag2.updatePager(Frag2.java:xxx)</code></p>
  
  <p>So my question, </p>
  
  <ul>
  <li>Irrespective of the visibility of a <code>Fragment</code> in a <code>ViewPager</code>, how can they (<code>Fragment</code>s) be kept ready with the latest content? </li>
  </ul>