title: Which function will be called when fragment resume
body: <p>Which function will be called when the <code>fragment</code> resume. </p>
  
  <p>I have read this question here <a href="https://stackoverflow.com/questions/25639927/settitle-when-fragment-is-visible-again">setTitle when Fragment is visible again</a> , but i must use the <code>add()</code> function. What should i do? <code>onResume</code> function is not called!</p>
  
  <p>EDIT:
  In MainActivity:</p>
  
  <pre><code>getSupportFragmentManager().beginTransaction().replace(R.id.container,fragmentA).commit();
  </code></pre>
  
  <p>when click a button in fragment A, the fragment B will be show:</p>
  
  <pre><code>onClick(View v){
      getSupportFragmentManager().beginTransaction().add(R.id.container,fragmentB).commit(); 
  }    
  </code></pre>
  
  <p>And when i press back button, it resume to fragment A, but onResume() function in A is not called. </p>