看图就明白了,三者之间的包含关系,然后再看下面的dumpsys,三者关系如此清晰。ActivityStack是统帅回退栈,里面是多个ActivityTask,Task里面又是record,record就是activity的记录,可能一个activity有多个record
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
Stack #1:
mFullscreen=true
mBounds=null
Task id #110
mFullscreen=true
mBounds=null
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
TaskRecord{b9d8211 #110 A=com.hcc.app U=0 StackId=1 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.hcc.app/com.adastragrp.hccn.capp.ui.activity.SplashActivity (has extras) }
Hist #0: ActivityRecord{44a9238 u0 com.hcc.app/com.adastragrp.hccn.capp.ui.activity.SplashActivity t110}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.hcc.app/com.adastragrp.hccn.capp.ui.activity.SplashActivity (has extras) }
ProcessRecord{5244e28 12413:com.hcc.app/u0a375}
Task id #84
mFullscreen=true
mBounds=null
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
TaskRecord{4c72176 #84 A=com.UCMobile U=0 StackId=1 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.UCMobile/.main.UCMobile (has extras) }
Hist #0: ActivityRecord{b28a899 u0 com.UCMobile/com.uc.browser.InnerUCMobile t84}
Intent { flg=0x10000000 cmp=com.UCMobile/com.uc.browser.InnerUCMobile }
ProcessRecord{b6dad3a 2762:com.UCMobile/u0a249}
Task id #88
mFullscreen=true
mBounds=null
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
TaskRecord{322c4a2 #88 A=com.android.settings U=0 StackId=1 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings (has extras) }
Hist #0: ActivityRecord{8c1f06d u0 com.android.settings/.Settings t88}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings (has extras) }
ProcessRecord{bdd227c 4220:com.android.settings/1000}
Running activities (most recent first):
TaskRecord{b9d8211 #110 A=com.hcc.app U=0 StackId=1 sz=1}
Run #2: ActivityRecord{44a9238 u0 com.hcc.app/com.adastragrp.hccn.capp.ui.activity.SplashActivity t110}
TaskRecord{4c72176 #84 A=com.UCMobile U=0 StackId=1 sz=1}
Run #1: ActivityRecord{b28a899 u0 com.UCMobile/com.uc.browser.InnerUCMobile t84}
TaskRecord{322c4a2 #88 A=com.android.settings U=0 StackId=1 sz=1}
Run #0: ActivityRecord{8c1f06d u0 com.android.settings/.Settings t88}
mResumedActivity: ActivityRecord{44a9238 u0 com.hcc.app/com.adastragrp.hccn.capp.ui.activity.SplashActivity t110}
Stack #0:
mFullscreen=true
mBounds=null
Task id #82
mFullscreen=true
mBounds=null
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
TaskRecord{eb41df5 #82 A=smartisanos.task.launcher U=0 StackId=0 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800100 cmp=com.smartisanos.launcher/.Launcher }
Hist #0: ActivityRecord{d145f2c u0 com.smartisanos.launcher/.Launcher t82}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10