Task activity stack always reset when launched from Home

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Task activity stack always reset when launched from Home

Postby zxrxy » Wed Nov 25, 2009 10:13 am

I am just starting on an Android app and I am puzzled about why my
Task activity stack is being reset any time the application is
launched from the Home screen.

I used the ADT tools to create the application in Eclipse.
The main activity is ".UserLaunch" and it starts the activity ".About"
when the user presses a button.
If the user then presses HOME and then relaunches the app, .UserLaunch
is displayed and is the only thing on the stack.

.UserLaunch has the launchMode singleTask. .About is standard.
According to the documentation at http://developer.android.com/guide/topi ... tml#lmodes:

"However, a "singleTask" activity may or may not have other
activities above it in the stack. If it does, it is not in position to
handle the intent, and the intent is dropped. (Even though the intent
is dropped, its arrival would have caused the task to come to the
foreground, where it would remain.) "

The Task stack should be brought to the foreground and .About should
still be displayed.

Here is the relevant section of the Manifest:

<application android:icon="@drawable/icon" android:label="@string/
<activity android:name=".UserLaunch" android:label="@string/app_name"
android:launchMode="singleTask" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<activity android:name=".About" android:launchMode="standard">

Anyone have any ideas why this is always resetting the Activity Stack?

The code that starts the .About activity is:
protected void startAbout()
Intent aIntent = new Intent(this, About.class);

The Manifest entries for .UserLaunch and .About are in my original
The intent that returns the task to the front is generated by the

What flags do I need to set (and where) to prevent this from
happening? Is one of the default values causing it?

My test case here is:
1) launch .UserLaunch from the launcher
2) start .About
3) hit Home key
4) launch .UserLuanch from the launcher

(even if I remove "singetask", it still can't remain the second activity.)
Posts: 2
Joined: Wed Nov 25, 2009 3:10 am


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest