title: How to add a listener for the up button in ActionBar on Android?
body: <p>I added the up button in the action bar of my android activity in this way:</p>
  
  <p>Activity:</p>
  
  <blockquote>
    <p>getSupportActionBar().setDisplayHomeAsUpEnabled(true);</p>
  </blockquote>
  
  <p>Manifest:</p>
  
  <blockquote>
    <p>android:parentActivityName=".MenuActivity"></p>
  </blockquote>
  
  <p>It work fine but now i want to add a transition effect between activities.
  This transition work well:</p>
  
  <blockquote>
    <p>Intent intent = new Intent(getApplicationContext(), MenuActivity.class);
            startActivity(intent);
            overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);</p>
  </blockquote>
  
  <p><strong>But where i should put this transition code? I dont have any listener for the back button in the action bar.</strong></p>
  
  <p>Thanks in advice guys</p>