Hi,

I have an app with two activities, one of which the launchmode is set
to "singleTask".  From the Android dev guide, I got the impression
that my SingleTaskActivity should start a new task (or reuse an old
task) and always sit at the root of the stack when launched.  However,
it's inconsistent with the behavior of the app if I follow the steps
below:
- launch StandardActivity from home
- click the "home" key
- launch SingleTaskActivity from home, you will see it's in the
foreground as expected
- click the "Back" key, StandardActivity comes to the foreground
whereas I expect to see the home screen because SingleTaskActivity is
supposed to be at the ROOT of the stack.  It appears
SingleTaskActivity was launched into the task that StandardActivity
started, rather than starting its own task.

Is my understanding about the "singleTask" launch mode correct?
Thanks,

-

PS:

=== The Android Dev guide (http://developer.android.com/guide/topics/
manifest/activity-element.html#lmode) says:

In contrast, "singleTask" and "singleInstance" activities can only
begin a task. They are always at the root of the activity stack.
Moreover, the device can hold only one instance of the activity at a
time — only one such task.

=== My AndroidManifest.xml file:
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".StandardActivity"
                  android:label="Standard">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SingleTaskActivity"
                  android:label="ActivitySingleTask"
                  android:launchMode="singleTask"
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to