title: Fragment: which callback invoked when press back button & customize it
body: <p>I have a fragment:</p>
  
  <pre><code>public class MyFragment extends Fragment{
       ...
       @Override
       public View onCreateView(...){...}    
       ...
  }
  </code></pre>
  
  <p>I instantiate it:</p>
  
  <pre><code>MyFragment myFragment = new MyFragment();
  </code></pre>
  
  <p>I use the above fragment to replace the current fragment:</p>
  
  <pre><code>FragmentManager fragmentManager = activity.getSupportFragmentManager();
  FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  
  // replace fragment
  fragmentTransaction.replace(R.id.fragment_placeholder, myFragment, "myTag");
  
  // NOTE: I did not add to back stack
  </code></pre>
  
  <p>Now, <code>myFragment</code> is showing on the screen. NOTE: I did not add <code>myFragment</code> to <strong>back stack</strong>.</p>
  
  <p><strong>My two questions:</strong></p>
  
  <p><strong>1.</strong> If now, I press mobile phone <strong>back</strong> button, which fragment's life cycle callback will be invoked?? </p>
  
  <p><strong>2.</strong> How can I customize the <strong>back button</strong> click listener in <code>MyFragment</code> class? (please do not suggest me to do <code>myFragment.getView().setOnclickListener</code>, but do it in <code>MyFragment</code> class)</p>