Android running Intents after my Activity has been destroyed
<p>I have some rather strange behaviour which I cannot understand at all.</p>

<p>I have two activities, MainThread and InfoScreen. MainThread is the main app thread and, as a part of its onCreate() contains:</p>

<pre><code>startActivity(new Intent(MainThread.this, InfoScreen.class));
</code></pre>

<p>This displays the info screen. When you click "dismiss" on the info screen, it calls .finish() on itself and we go back to the main screen. It all works great in normal circumstances - all the activities start and stop exactly when I imagine they would.</p>

<p>The circumstance where it behaves oddly is this: In my MainThread, I use a camera intent. This occasionally runs out of memory, causing the OS to destroy my MainThread and then recreate it. That's fine... except when it gets to the above line of code, the Intent is created fine but onCreate() is <em>not</em> called in my InfoScreen class. The OS then immediately mysteriously destroys my MainThread again and recreates it again (out of memory again, maybe?). This time it manages to start the InfoScreen.</p>

<p>However...</p>

<p>... as soon as I click "dismiss" on this shiny new InfoScreen, another instance of my InfoScreen is magically created (and the onCreate event is fired).</p>

<p>What on earth is happening? Is Android somehow queueing the Intent from the destroyed process and then deciding to run it much later? And why is it deciding to run it as soon as my real instance of it finishes?</p>

<p>Any help much appreciated.</p>
