title: How to recreate all fragments in ViewPager:
body: <p>I have this problem, I have a <code>FragmentActivity</code> with a <code>ViewPager</code> and a <code>ViewPagerAdapter</code>.</p>
  
  <p>In this ViewPager I have 3 <code>Fragments</code> that each of them contains a <code>TableLayout</code> that gets populated programmaticly using a <code>2dArrayList</code>. </p>
  
  <p>on a click of a button in the <code>FragmentActivity</code> layout, I filter the data in the <code>2dArrayList</code> and basically need to recreate all 3 <code>Fragments</code> with the new dataset (run the <code>onCreateView</code> method in all of them).</p>
  
  <p>So I create an <code>onClickListener</code> for this button:</p>
  
  <pre><code> private class SlicerSelectedOnClickListener implements OnClickListener {
  
      private ODSharedSlicer slicer;
  
      public SlicerSelectedOnClickListener(ODSharedSlicer slicer) {
          super();
          this.slicer = slicer;
      }
  
      public void onClick(View v) {
          String slicerValue = ((Button) v).getText().toString();
          Log.d(TAG,"Slicer value: "+ slicerValue +" chosen");
          application.currentReport.getODSharedSlicers().get(0).getSharedSlicerSelectedMemebers().add(slicerValue);
  
          ViewGroup parent = (ViewGroup) ((Button) v).getParent();
  
          for (int i = 0; i &lt; parent.getChildCount(); i++) 
          {
              if ((parent.getChildAt(i) != v) &amp;&amp; (parent.getChildAt(i) instanceof ToggleButton))
              {
                  ((ToggleButton) parent.getChildAt(i)).setChecked(false);
              }
          }
  
          mPagerAdapter.notifyDataSetChanged();
      }
  }
  </code></pre>
  
  <p>As you can see I have a <code>mPagerAdapter.notifyDataSetChanged();</code>
  As suggested here:</p>
  
  <p><a href="https://stackoverflow.com/questions/15179086/how-to-recreate-fragment-with-viewpager-intentionally">How to recreate fragment with viewpager intentionally?</a></p>
  
  <p>at the end of this method, So I expect the adapter to recreate all the <code>Fragment</code>s, but the <code>onCreateView</code> from any of the fragments never runs.</p>
  
  <p>Can any one suggest what am I doing wrong.
  any assistance would be appreciated.</p>