I understand that launchMode:"singleTask" means that if an activity has previously been created and is requested in future to show up , Android will simply show the old one instead of creating a new instance. The problem i am facing can be illustrated with an example :-
Lets Say we have two activities
A actvity
B (Activity with launchMode="singleTask") enabled (This is all that is in its Manifest Declaration)
Now , if A creates an Intent which corresponds to B (A->B) , then A gets Finished and is removed from the activity stack . How can i prevent this from happening . What i want is that when A calls B (Creates an Intent) previous instance of B is returned and A remains as it is and is not destroyed . Thank you for helping . Any help is appreciated
EDIT
<activity
android:name="com.example.Activities.A"
android:launchMode="singleTask"
android:clearTaskOnLaunch="false"
android:finishOnTaskLaunch="false"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.Activities.B"
android:launchMode="singleTask"
android:clearTaskOnLaunch="false"
android:finishOnTaskLaunch="false"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>