title: Lifecycle of fragments on a hosting ViewPager activity
body: <p>I have two fragments on an activity hosting them, by a ViewPager.
  When I update Fragment A's data , it doesn't on the display.
  So I figured I should play with the lifecycle...I placed locates at all of the lifecycle callbacks and none were invoked when I was sliding through the fragments. 
  Don't the fragments change though the lifecycle when you slide between them?
  So how do you refresh their content ?</p>
  
  <p>my code as an exmaple:</p>
  
  <p>fragment b :
  when a button is clicked it needs to update the list in fragment A and fragment should display it.</p>
  
  <pre><code>private RemoveFromHistoryInterface removeFromHistory = new RemoveFromHistoryInterface()
  {
      @Override
      public void removeFromHistory( List&lt;Password&gt; passwordsToRemove )
      {
          PagerActivity.removeFromHistory( passwordsToRemove );
      }
  };
  
  public interface RemoveFromHistoryInterface
  {
      public void removeFromHistory( List&lt;Password&gt; passwordsToRemove  );
  }
  ...
  ...
  
  removeFromHistory.removeFromHistory( listToRemove );
  </code></pre>
  
  <p>Pager activity (which is hosting both fragments)</p>
  
  <pre><code>public static void removeFromHistory( List&lt;Password&gt; passwordsToRemove )
      {
          MainFragment.fromHistoryToMain( passwordsToRemove );
      }
  </code></pre>
  
  <p>Fragment A : </p>
  
  <p>@</p>
  
  <pre><code>Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          passwords = PasswordManager.getInstance().getPasswords();
          passwordsList = Password.getPasswordsList();
      }
  ...
  ...
      public static void fromHistoryToMain( List&lt;Password&gt; listBackToMain )
          {
              passwordsList.addAll( 0, listBackToMain );
          }
  </code></pre>
  
  <p>viewpager adapter:</p>
  
  <pre><code>  public class ViewPagerAdapter extends FragmentPagerAdapter 
      {
  
      final int PAGE_COUNT = 2;
      private String tabTitles[] = new String[] { "Main", "History" };
  
      public ViewPagerAdapter( FragmentManager fragmentManager ) 
      {
          super( fragmentManager );
      }
  
      @Override
      public int getCount() {
          return PAGE_COUNT;
      }
  
      @Override
      public Fragment getItem( int position ) 
      {
          switch ( position ) 
          {
              case 0:
                  return new MainFragment();
  
              case 1:
                  return new HistoryFragment();   
              }
          return null;
      }
  
      @Override
      public CharSequence getPageTitle( int position ) 
      {
          return tabTitles[position];
      }
  }
  </code></pre>