title: How to show a dialog to confirm that the user wishes to exit an Android Activity?
body: <p>I've been trying to show a "Do you want to exit?" type of dialog when the user attempts to exit an Activity.  </p>
  
  <p>However I can't find the appropriate API hooks.  <code>Activity.onUserLeaveHint()</code> initially looked promising, but I can't find a way to stop the Activity from finishing.</p>