title: Why is calling Process.killProcess(Process.myPid()) a bad idea?
body: <p>I've read some posts stating that using this method is "not good", shouldn't be used, it's not the right way to "close" the application and it's not how Android works... </p>
  
  <p>I understand and accept the fact that the Android OS knows better than me when it's the right time to terminate the process, but I haven't yet heard a good explanation on why it's wrong to use the <code>killProcess()</code> method.  After all - it's part of the Android API.   </p>
  
  <p>What I do know is that calling this method while other threads are doing potentially important work (operations on files, writing to DB, HTTP requests, running services..) results in the threads being terminated and it's clearly not good.  Also, I know I can benefit from the fact that "re-opening" the application will be faster because the system stills "holds" in memory state from the last time the app was used, and <code>killProcess()</code> prevents that.</p>
  
  <p>Besides this reason, assuming I don't have such operations, and I don't care my application whether my app will start from scratch every time it is opened, are there other reasons why I should not use the <code>killProcess()</code> method?</p>
  
  <p>I know about the <code>finish()</code> method to close an <code>Activity</code>, so please don't include that in your answer.</p>
  
  <p><code>finish()</code> is only for <code>Activity</code>, not for all applications, and I think I know exactly why and when to use it.</p>
  
  <p>And another thing - I'm developing games with the Unity3D framework and exporting the project to Android. When I decompiled the generated apk, I was very surprised to find out that the java source code created from unity - implementing Unity's - <code>Application.quit()</code> method, with <code>Process.killProcess(Process.myPid())</code>. </p>
  
  <p><code>Application.quit()</code> is supposed to be the right way to close the game according to the Unity3D docs (Is it really? Maybe I'm wrong and missed something), so why did the Unity's framework developers implement this in native Android?</p>