What will happen when System.exit(0) execute?
<p>I have two different activities. The first launches the second one. </p>

<pre><code>Intent intent = new Intent(this, Activity2.class);
startActivity(intent);
</code></pre>

<p>In the second activity I call System.exit(0).
The first activity comes back caused by 'page stack' I think.
But I found two things happened.</p>

<ol>
<li>the variant in progress lost its value. (The progress restart I think)</li>
<li>the file created in first activity, and appended data in second activity and saved, lost!(erased from sandbox). The file I created using <code>applicationContext.openFileOutput(fileName, Context.MODE_PRIVATE);</code> </li>
</ol>

<p>Was sandbox cleaned in that situation? The normal exit by 'return key' or even by <code>android.os.Process.killProcess(android.os.Process.myPid())</code>, the file in sandbox was kept.
So, what actually happened when System.exit(0) execute?</p>

<p>Thanks!</p>
