I am reading about taskaffinity & created a demo app with following Activities :
- A
- B ===> taskaffinity, com.ando
- C
- D ===> taskaffinity, com.ando
- E
It is written that, Activities with same taskaffinity secretly opens the single instance of another one.
So, I put log in onResume of every activity to see task id. If it creates single instance then why its not executing onResume of B when I open D and vice-versa.
I read developers site and other post but still not got how to use taskaffinity and whats its use, why we should'tn use singleInstance instead ?
Manifest:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.danroid.taskaffinity.A"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- android:taskAffinity="com.ando" -->
<activity
android:name="com.example.danroid.taskaffinity.B"
android:label="@string/app_name"
android:taskAffinity="@string/task_affinity" >
</activity>
<activity
android:name="com.example.danroid.taskaffinity.C"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.example.danroid.taskaffinity.D"
android:label="@string/app_name"
android:taskAffinity="@string/task_affinity" >
</activity>
<activity
android:name="com.example.danroid.taskaffinity.E"
android:label="@string/app_name" >
</activity>
</application>