Hi
I am trying to understand the interactions among apps, processes, activities,
and tasks. After reading 'Application Fundamentals' many times, I wrote a tiny
piece of code with three different activities. Here's my manifest file:

<application android:icon="@drawable/icon" android:label="ABC">
       <activity android:name=".AppRootActivity"
                 android:label="App1">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER"/>
           </intent-filter>
       </activity>

       <activity android:name=".ChildActivityOfRoot"
                 android:label="ChildActivity:ChildOfAppRootActivity">
       </activity>

       <activity android:name=".SingleTaskActivity"
                 android:label="ChildActivity:SingleTaskActivity"
                 android:launchMode="singleTask">
       </activity>
</application>

The AppRootActivity starts ChildActivityOfRoot which in turn starts
SingleTaskActivity.

Since 'SingleTaskActivity' is marked with 'singleTask' launchMode I expected
two different tasks with the following activity sets:
Task1 --> AppRootActivity - ChildActivityOfRoot
Task2 --> SingleTaskActivity

However, I was surprised to see all three activities running in the same task.
This doesn't change even if I use Intent.FLAG_ACTIVITY_NEW_TASK flag in the
intent used to activate 'SingleTaskActivity'. I use the getTaskId() to
determine
the task the activity is running.

IMO this behavior is not at all apparent from the documentation. Can someone
shed more light?

Thanks

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to