#2
一bird一2019-08-13 18:49
|
<activity
android:name=".MainActivity"
android:process="com.test.apptask"
android:launchMode="singleTask"
android:allowTaskReparenting="true"
android:alwaysRetainTaskState="true"
android:taskAffinity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".TestActivity"
android:process=":test"
android:launchMode="singleTask"
android:allowTaskReparenting="true"
android:alwaysRetainTaskState="true"
android:taskAffinity=".TestActivity"/>
我打开主应用(MainActivity),然后打开这个TestActivity,我按home回到主界面,看最近打开应用,这是会出现两个任务栈,在移除TestActivity对应的Task的时候主进程也被关闭了