Android: Behaviour of launchMode="singleTask" not as described?
<p>I've been learning Android and have come across an issue with launchMode="singleTask". The documentation states that when this attribute is used, the Activity is always launched into a new task as the root Activity. Secondly, the documentation states that if an Intent is targeted at such an Activity when there are Activities sitting above it in its task stack, such Intents are discarded (although the task is still brought to the foreground).</p>

<p>I've been playing around with this, and the behaviour I observe is completely different. In particular:
- Activities with launchMode="singleTask" are not always the root Activity in a task stack. They are just plonked ontop of the existing stack with the same affinity.
- When an Intent is targeted at such an Activity and there are other Activities above it in the stack, the Intent is not discarded. Instead the Activities above it in the stack are discarded. The Intent is then delivered via onNewIntent to the Activity as normal.</p>

<p>Can someone confirm that this is the actual behaviour? If so, why are the documents incorrect? If not what have I done wrong. . .</p>

<p>EDIT:</p>

<p>An example demonstrating this behaviour can be found here:
<a href="http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#">http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#</a>
Sorry for the cross-post, however I was unable to get the example in a decent format to post here...</p>
