title: Mobile app exit confirmation
body: <p>What I need is to provide an exit confirmation dialog for my mobile app.</p>
  
  <p>The dialog is to appear when users taps the <code>Back</code> button on their phones. I know two options i.e.</p>
  
  <ol>
  <li>"Press back again if you really wish to exit" type of message.</li>
  <li>"Do you really wish to exit + Yes/No" dialog.</li>
  </ol>
  
  <p>I am exploring the second variant.</p>
  
  <p>The problem I see primarily concerns the windows store apps.</p>
  
  <p>If I show it and give user time to decide than I have already cancelled the default behavior. </p>
  
  <p>For windows store app it is <code>Windows.Phone.UI.Input.HardwareButtons.BackPressed</code> i.e. I've set the <code>Windows.Phone.UI.Input.BackPressedEventArgs.Handled</code> to true.</p>
  
  <p>What do I do if user clicks <code>Yes</code> i.e. confirms his intent to exit the app? </p>
  
  <p>I've read the <a href="https://stackoverflow.com/questions/9028373/metro-app-can-no-longer-be-programmatically-killed">Metro App can no longer be programmatically killed</a> and do understand that programmatically closing the windows store app is considered "unacceptable". Does it mean that such an exit confirmation dialog is banned for windows platform?</p>
  
  <p>What about Android? Is it ok there to exit the app programmatically?</p>