title: How do I make a fragment's onActivityCreated method run again?
body: <p>I have one Activity that instanciates some fragments:</p>
  
  <pre><code>List&lt;Fragment&gt; fragments = new ArrayList&lt;Fragment&gt;();
  fragments.add(Fragment.instantiate(this, HomeFragment.class.getName()));
  fragments.add(Fragment.instantiate(this, BorrowedFragment.class.getName()));
  fragments.add(Fragment.instantiate(this, LentFragment.class.getName()));
  fragments.add(Fragment.instantiate(this, PeopleFragment.class.getName()));
  </code></pre>
  
  <p>Those fragments are linked to a ViewPager. Each fragment runs a SELECT statement and shows the contents as a list to the user.</p>
  
  <p>The problem is that in the HomeFragment, I have a button that when clicked, it shows to the user a Form, so he can add information to this Table. When user adds the information, I finish() the activity and the HomeFragment is shown  again.
  When I swype to the BorrowFragment nothing is shown there. I have to swype to PeopleFragment (the last one of the list) and come back to BorrowedFragment. Only then, the information is shown.</p>
  
  <p>The only thing I do at the moment when the information is inserted is:</p>
  
  <pre><code>Button btDone = (Button) findViewById(R.id.buttonDone);
          btDone.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  if(ck1.isChecked())
                      isIOwe = true;
                  else
                      isIOwe = false;
                  insertRecord();
                  Toast.makeText(getApplicationContext(), "Record added", Toast.LENGTH_SHORT).show();
                  /*FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                  ft.add(Fragment.instantiate(ctx, PeopleFragment.class.getName()), "test");
                  ft.commit();*/
                  finish();
  
              }
          });
  </code></pre>
  
  <p>I've been wondering if there's something I should do with the FragmentTransaction, to be able to restart the lifecyle of the fragments.</p>
  
  <p>Any help?</p>
  
  <p>Thanks,
  Felipe</p>