title: How to fully close a Delphi-XE5 Android App
body: <p>This has been asked before but not fully answered and I don't have the "reputation" to comment there. I want to exit an app for two reasons. 1. on startup if problems with the data files and 2. from a back-button press.</p>
  
  <p>Another questioner got answers of using: </p>
  
  <pre><code>SharedActivity.Finish;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>MainActivity.Finish;
  </code></pre>
  
  <p>Both appear to close the window but neither exit the application as in debug mode the program does not end in Delphi and the application is still running on the device itself.</p>
  
  <p>Any more ideas? The hardware is a Nexus 4.</p>