title: How to detect if the Up button was pressed
body: <p>In my activity the action bar shows only the left arrow and the title of the activity.</p>
  
  <p>When I press the left arrow the activity goes back to the previous activity, but no event is registered in the onKeyUp, OnkeyDown and OnBackPressed methods.</p>
  
  <p>But when I press the Back key on the phone (at the bottom) the activity goes back to the previous one and all the methods onKeyUp, OnKeyDown and OnBackPressed register an event (in the logcat).</p>
  
  <p>How can I capture that left arrow (I think it is called the UP button)?</p>
  
  <p>The reason I need to capture the key is to know in the onPause method that the activity is destroyed by the user and not by the system (for example, if the user switches to another activity).</p>
  
  <p>By further investigating he matter I found out that the UP button gives an event that is captured by the onOptionsItemSelected method and since there is no other button on the menu I know it is this button.</p>