ActivityDisplay/ActivityStack/TaskRecord/ActivityRecord,这几个关键的类,我以前一直搞不清其具体关系,看了android里面的Activity体系结构(1)_ActivityDisplay/ActivityStack/TaskRecord/ActivityRecord这篇文章后,才有了一点点明白,对应也做一个笔记。
四个类的整体关系图如下
我直接复制他的图片:
通过adb shell dumpsys activity activities 命令可以看到如下打印:
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
Stack #2: type=standard mode=fullscreen
isSleeping=false
mBounds=Rect(0, 0 - 0, 0)
Task id #89
mBounds=Rect(0, 0 - 0, 0)
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
* TaskRecord{d966e2f #89 A=com.android.messaging U=0 StackId=2 sz=1}
userId=0 effectiveUid=u0a50 mCallingUid=1000 mUserSetupComplete=true mCallingPackage=com.android.launcher3
affinity=com.android.messaging
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.messaging/.ui.conversationlist.ConversationListActivity}
mActivityComponent=com.android.messaging/.ui.conversationlist.ConversationListActivity
autoRemoveRecents=false isPersistable=true numFullscreen=1 activityType=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}]
askedCompatMode=false inRecents=true isAvailable=true
mRootProcess=ProcessRecord{83e347 4227:com.android.messaging/u0a50}
stackId=2
hasBeenVisible=true mResizeMode=RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION mSupportsPictureInPicture=false isResizeable=true lastActiveTime=179867 (inactive for 36s)
* Hist #0: ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}
packageName=com.android.messaging processName=com.android.messaging
launchedFromUid=1000 launchedFromPackage=com.android.launcher3 userId=0
app=ProcessRecord{83e347 4227:com.android.messaging/u0a50}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.messaging/.ui.conversationlist.ConversationListActivity bnds=[616,1383][909,1575] }
frontOfTask=true task=TaskRecord{d966e2f #89 A=com.android.messaging U=0 StackId=2 sz=1}
taskAffinity=com.android.messaging
mActivityComponent=com.android.messaging/.ui.conversationlist.ConversationListActivity
baseDir=/system/priv-app/Messaging_royole/Messaging_royole.apk
dataDir=/data/user/0/com.android.messaging
stateNotNeeded=false componentSpecified=true mActivityType=standard
compat={320dpi always-compat} labelRes=0x7f12005b icon=0x7f0801d9 theme=0x7f130102
mLastReportedConfigurations:
mGlobalConfig={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} s.8}
mOverrideConfig={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.1}
CurrentConfiguration={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.1}
taskDescription: label="null" icon=null iconResource=0 iconFilename=null primaryColor=ffffffff
backgroundColor=fffafafa
statusBarColor=0
navigationBarColor=ffffffff
launchFailed=false launchCount=1 lastLaunchTime=-36s625ms
haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false finishing=false
keysPaused=false inHistory=true visible=true sleeping=false idle=true mStartingWindowState=STARTING_WINDOW_SHOWN
fullscreen=true noDisplay=false immersive=false launchMode=0
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=standard
nowVisible=true lastVisibleTime=-36s123ms
resizeMode=RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION
mLastReportedMultiWindowMode=false mLastReportedPictureInPictureMode=false
Running activities (most recent first):
TaskRecord{d966e2f #89 A=com.android.messaging U=0 StackId=2 sz=1}
Run #0: ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}
mResumedActivity: ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}
Stack #0: type=home mode=fullscreen
isSleeping=false
mBounds=Rect(0, 0 - 0, 0)
Task id #87
mBounds=Rect(0, 0 - 0, 0)
mMinWidth=-1
mMinHeight=-1
mLastNonFullscreenBounds=null
* TaskRecord{5f96c3c #87 I=com.android.launcher3/.Launcher U=0 StackId=0 sz=1}
userId=0 effectiveUid=1000 mCallingUid=0 mUserSetupComplete=true mCallingPackage=null
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher}
mActivityComponent=com.android.launcher3/.Launcher
autoRemoveRecents=false isPersistable=true numFullscreen=1 activityType=2
rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{12984fc u0 com.android.launcher3/.Launcher t87}]
askedCompatMode=false inRecents=true isAvailable=true
mRootProcess=ProcessRecord{48bd69b 2716:com.android.launcher3/1000}
stackId=0
hasBeenVisible=true mResizeMode=RESIZE_MODE_RESIZEABLE mSupportsPictureInPicture=false isResizeable=true lastActiveTime=179789 (inactive for 36s)
* Hist #0: ActivityRecord{12984fc u0 com.android.launcher3/.Launcher t87}
packageName=com.android.launcher3 processName=com.android.launcher3
launchedFromUid=0 launchedFromPackage=null userId=0
app=ProcessRecord{48bd69b 2716:com.android.launcher3/1000}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher }
frontOfTask=true task=TaskRecord{5f96c3c #87 I=com.android.launcher3/.Launcher U=0 StackId=0 sz=1}
taskAffinity=null
mActivityComponent=com.android.launcher3/.Launcher
baseDir=/system/priv-app/Launcher_royole/Launcher_royole.apk
dataDir=/data/user/0/com.android.launcher3
stateNotNeeded=true componentSpecified=false mActivityType=home
compat={320dpi always-compat} labelRes=0x7f11009f icon=0x7f0e0005 theme=0x7f120017
mLastReportedConfigurations:
mGlobalConfig={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} s.17}
mOverrideConfig={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=home mAlwaysOnTop=undefined mRotation=ROTATION_0} s.2}
CurrentConfiguration={ 1.0 ?mcc?mnc [zh_CN] ldltr sw760dp w760dp h738dp 320dpi lrg hdr port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1520, 1620) mAppBounds=Rect(0, 0 - 1520, 1524) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=home mAlwaysOnTop=undefined mRotation=ROTATION_0} s.2}
RequestedOverrideConfiguration={null 0.0 ?mcc?mnc ?localeList ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?ldr ?wideColorGamut ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=null mWindowingMode=undefined mDisplayWindowingMode=undefined mActivityType=home mAlwaysOnTop=undefined mRotation=undefined}}
taskDescription: label="null" icon=null iconResource=0 iconFilename=null primaryColor=fff5f5f5
backgroundColor=fffafafa
statusBarColor=0
navigationBarColor=0
launchFailed=false launchCount=0 lastLaunchTime=-1m17s119ms
haveState=true icicle=Bundle[mParcelledData.dataSize=10292]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true mStartingWindowState=STARTING_WINDOW_NOT_SHOWN
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=home
nowVisible=false lastVisibleTime=-45s897ms
connections={ConnectionRecord{4665a11 u0 CR com.android.launcher3/com.royole.sidesplitscreen.SideSplitScreenService:@1cfca38}}
resizeMode=RESIZE_MODE_RESIZEABLE
mLastReportedMultiWindowMode=false mLastReportedPictureInPictureMode=false
Running activities (most recent first):
TaskRecord{5f96c3c #87 I=com.android.launcher3/.Launcher U=0 StackId=0 sz=1}
Run #0: ActivityRecord{12984fc u0 com.android.launcher3/.Launcher t87}
mLastPausedActivity: ActivityRecord{12984fc u0 com.android.launcher3/.Launcher t87}
ResumedActivity:ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}
ResumedActivity: ActivityRecord{8bc12ef u0 com.android.messaging/.ui.conversationlist.ConversationListActivity t89}
说明:
1.在#0的ActivityDisplay上,总共有2个Stack,代表2个应用
2.在Stack #2里面,有一个TaskRecord,Task id #89
3.在TaskRecord里面,Activities列表里面只有一个ActivityRecord
四个类的定义相关介绍
这个我也直接使用其制作的图片:
四个类的关键变量
ActivityDisplay 类有如下关键变量
/**
* Exactly one of these classes per Display in the system. Capable of holding zero or more
* attached {@link ActivityStack}s.
*/
class ActivityDisplay extends ConfigurationContainer<ActivityStack>
implements WindowContainerListener {
......
DisplayContent mDisplayContent; // 对应WindowManagerService的显示
/** Actual Display this object tracks. */
int mDisplayId; // id
/**
* All of the stacks on this display. Order matters, topmost stack is in front of all other
* stacks, bottommost behind. Accessed directly by ActivityManager package classes. Any calls
* changing the list should also call {@link #onStackOrderChanged()}.
*/
// 当前显示屏上的所有ActivityStack
private final ArrayList<ActivityStack> mStacks = new ArrayList<>();
ActivityStack类有如下关键变量
/**
* State and management of a single stack of activities.
*/
public class ActivityStack extends ConfigurationContainer {
......
final int mStackId; // 唯一ID
/** The attached Display's unique identifier, or -1 if detached */
int mDisplayId; // 所处的显示屏id,如果detach则为-1
/**
* The back history of all previous (and possibly still
* running) activities. It contains #TaskRecord objects.
*/
// ActivityStack里面所包含的所有TaskRecord对象
private final ArrayList<TaskRecord> mTaskHistory = new ArrayList<>();
TaskStack mTaskStack; // 对应WindowManagerService里面的
/**
* Current activity that is resumed, or null if there is none.
*/
ActivityRecord mResumedActivity = null; // 当前resume状态的Activity
TaskRecord 类有如下关键变量:
class TaskRecord extends ConfigurationContainer {
......
final int taskId; // Unique identifier for this task.
/** List of all activities in the task arranged in history order */
final ArrayList<ActivityRecord> mActivities; // 当前Task里面所包含的所有Activity对象
/** Current stack. Setter must always be used to update the value. */
private ActivityStack mStack; // 所属的ActivityStack
Task mTask; // 对应WindowManagerService里面的
ActivityRecord 类有如下关键变量:
/**
* An entry in the history stack, representing an activity.
*/
public final class ActivityRecord extends ConfigurationContainer {
......
final IApplicationToken.Stub appToken; // window manager token
// TODO: Remove after unification
AppWindowToken mAppWindowToken; // 继承自WindowToken,代表一种window类型,为应用窗口
// activity相关的信息
final ActivityInfo info; // all about me
private TaskRecord task; // the task this is in.
// ActivityRecord在初始化的时候会创建Token对象,作为服务端
static class Token extends IApplicationToken.Stub
ActivityRecord 类中有ActivityInfo 类的变量info:
我们再看一下ActivityInfo 类:
ActivityInfo 类就是表示应用中AndroidManifest.xml配置文件中activity和receiver的配置信息。其关键的变量,我们在其构造方法中可以看到:
/**
* Information you can retrieve about a particular application
* activity or receiver. This corresponds to information collected
* from the AndroidManifest.xml's <activity> and
* <receiver> tags.
*/
public class ActivityInfo extends ComponentInfo implements Parcelable {
......
public ActivityInfo(ActivityInfo orig) {
super(orig);
theme = orig.theme;
launchMode = orig.launchMode;
documentLaunchMode = orig.documentLaunchMode;
permission = orig.permission;
taskAffinity = orig.taskAffinity;
targetActivity = orig.targetActivity;
flags = orig.flags;
privateFlags = orig.privateFlags;
screenOrientation = orig.screenOrientation;
configChanges = orig.configChanges;
softInputMode = orig.softInputMode;
uiOptions = orig.uiOptions;
parentActivityName = orig.parentActivityName;
maxRecents = orig.maxRecents;
lockTaskLaunchMode = orig.lockTaskLaunchMode;
windowLayout = orig.windowLayout;
resizeMode = orig.resizeMode;
mInitResizeMode = orig.mInitResizeMode;
requestedVrComponent = orig.requestedVrComponent;
rotationAnimation = orig.rotationAnimation;
colorMode = orig.colorMode;
maxAspectRatio = orig.maxAspectRatio;
minAspectRatio = orig.minAspectRatio;
}
其ActivityRecord 类的dump信息为:
四个类如何关联
ActivityRecord创建
在startActivity的过程中,会先new ActivityRecord
ActivityTaskManager: at com.android.server.wm.ActivityRecord.setState(ActivityRecord.java:1857)
ActivityTaskManager: at com.android.server.wm.ActivityRecord.<init>(ActivityRecord.java:964)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:902)
其具体流程为:
在ActivityStarter.startActivity中:
ActivityRecord r = new ActivityRecord(mService, callerApp, callingPid, callingUid,
callingPackage, intent, resolvedType, aInfo, mService.getGlobalConfiguration(),
resultRecord, resultWho, requestCode, componentSpecified, voiceSession != null,
mSupervisor, checkedOptions, sourceRecord);
在ActivityRecord.,也就是ActivityRecord的构造方法ActivityRecord中:
setState(INITIALIZING, "ActivityRecord ctor");
ActivityStack创建以及和ActivityDisplay的关联
ActivityStack也在是startActivity的过程中创建的
ActivityTaskManager: at com.android.server.wm.ActivityStack.<init>(ActivityStack.java:511)
ActivityTaskManager: at com.android.server.wm.ActivityDisplay.createStackUnchecked(ActivityDisplay.java:465)
ActivityTaskManager: at com.android.server.wm.ActivityDisplay.createStack(ActivityDisplay.java:455)
ActivityTaskManager: at com.android.server.wm.ActivityDisplay.getOrCreateStack(ActivityDisplay.java:383)
ActivityTaskManager: at com.android.server.wm.ActivityDisplay.getOrCreateStack(ActivityDisplay.java:401)
ActivityTaskManager: at com.android.server.wm.RootActivityContainer.getLaunchStack(RootActivityContainer.java:1737)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.getLaunchStack(ActivityStarter.java:2704)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.computeStackFocus(ActivityStarter.java:2612)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.setTaskFromReuseOrCreateNewTask(ActivityStarter.java:2323)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivityUnchecked(ActivityStarter.java:1688)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:1404)
在ActivityStack的构造方法中,会调用ActivityDisplay的addChild方法,
display.addChild(this, onTop ? POSITION_TOP : POSITION_BOTTOM);
其display,就是ActivityDisplay变量,其ActivityDisplay–add方法为:
void addChild(ActivityStack stack, int position) {
if (position == POSITION_BOTTOM) {
position = 0;
} else if (position == POSITION_TOP) {
position = mStacks.size();
}
if (DEBUG_STACK) Slog.v(TAG_STACK, "addChild: attaching " + stack
+ " to displayId=" + mDisplayId + " position=" + position);
addStackReferenceIfNeeded(stack);
positionChildAt(stack, position);
mService.updateSleepIfNeededLocked();
}
将自己加入到ActivityDisplay的mStack里面,mStack定义如下
ArrayList<ActivityStack> mStacks
此时,ActivityDisplay和ActivityStack关联起来
TaskRecord创建以及和ActivityStack的关联
TaskRecord也在是startActivity的过程中创建的
ActivityTaskManager: at com.android.server.wm.TaskRecord.create(TaskRecord.java:2704)
ActivityTaskManager: at com.android.server.wm.ActivityStack.createTaskRecord(ActivityStack.java:5515)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.setTaskFromReuseOrCreateNewTask(ActivityStarter.java:2330)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivityUnchecked(ActivityStarter.java:1688)
在ActivityStack.createTaskRecord方法里面,调用addTask将TaskRecord和ActivityStack关联起来
ActivityStack.createTaskRecord方法:
TaskRecord createTaskRecord(int taskId, ActivityInfo info, Intent intent,
IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor,
boolean toTop, ActivityRecord activity, ActivityRecord source,
ActivityOptions options) {
final TaskRecord task = TaskRecord.create(
mService, taskId, info, intent, voiceSession, voiceInteractor);
// add the task to stack first, mTaskPositioner might need the stack association
addTask(task, toTop, "createTaskRecord");
......
将task加入 mTaskHistory,其定义如下
private final ArrayList<TaskRecord> mTaskHistory = new ArrayList<>();
其ActivityStack.addTask的方法如下:
// TODO: This shouldn't allow automatic reparenting. Remove the call to preAddTask and deal
// with the fall-out...
void addTask(final TaskRecord task, int position, boolean schedulePictureInPictureModeChange,
String reason) {
......
mTaskHistory.add(position, task);
事实上,我们创建TaskRecord的接口在ActivityStarter–setTaskFromReuseOrCreateNewTask方法中:
private int setTaskFromReuseOrCreateNewTask(TaskRecord taskToAffiliate) {
......
// Do no move the target stack to front yet, as we might bail if
// isLockTaskModeViolation fails below.
if (mReuseTask == null) {
final boolean toTop = !mLaunchTaskBehind && !mAvoidMoveToFront;
final TaskRecord task = mTargetStack.createTaskRecord(
mSupervisor.getNextTaskIdForUserLocked(mStartActivity.mUserId),
mNewTaskInfo != null ? mNewTaskInfo : mStartActivity.info,
mNewTaskIntent != null ? mNewTaskIntent : mIntent, mVoiceSession,
mVoiceInteractor, toTop, mStartActivity, mSourceRecord, mOptions);
......
TaskRecord和ActivityRecord的关联
在上面分别创建了ActivityRecord和TaskRecord对象,
ActivityTaskManager: at com.android.server.wm.ActivityStarter.addOrReparentStartingActivity(ActivityStarter.java:2574)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.setTaskFromReuseOrCreateNewTask(ActivityStarter.java:2335)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivityUnchecked(ActivityStarter.java:1688)
ActivityTaskManager: at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:1404)
在setTaskFromReuseOrCreateNewTask方法里面,先调用createTaskRecord来创建TaskRecord,然后调用addOrReparentStartingActivity来设置Activity与TaskRecord的关系
ActivityStarter–setTaskFromReuseOrCreateNewTask
private int setTaskFromReuseOrCreateNewTask(TaskRecord taskToAffiliate) {
......
// Do no move the target stack to front yet, as we might bail if
// isLockTaskModeViolation fails below.
if (mReuseTask == null) {
final boolean toTop = !mLaunchTaskBehind && !mAvoidMoveToFront;
final TaskRecord task = mTargetStack.createTaskRecord(
mSupervisor.getNextTaskIdForUserLocked(mStartActivity.mUserId),
mNewTaskInfo != null ? mNewTaskInfo : mStartActivity.info,
mNewTaskIntent != null ? mNewTaskIntent : mIntent, mVoiceSession,
mVoiceInteractor, toTop, mStartActivity, mSourceRecord, mOptions);
addOrReparentStartingActivity(task, "setTaskFromReuseOrCreateNewTask - mReuseTask");
......
ActivityStarter.addOrReparentStartingActivity
private void addOrReparentStartingActivity(TaskRecord parent, String reason) {
// 如果当前ActivityRecord没有设置TaskRecord或者已经设置过就是给定的parent,则添加到mActivities列表里面
if (mStartActivity.getTaskRecord() == null || mStartActivity.getTaskRecord() == parent) {
parent.addActivityToTop(mStartActivity); // 会调用r.setTask(this)设置关联关系
} else {
// 将当前要启动的Activity重新关联到给定的parent 上
mStartActivity.reparent(parent, parent.mActivities.size() /* top */, reason);
}
}
其mStartActivity变量为::
// Share state variable among methods when starting an activity.
private ActivityRecord mStartActivity;
其parent变量为:
TaskRecord parent
activity和window的关系
关于Task管理一个简单对应关系:
从整体界面的关系来看:
参考资料
(1)android里面的Activity体系结构(1)_ActivityDisplay/ActivityStack/TaskRecord/ActivityRecord
https://blog.youkuaiyun.com/weixin_42695485/article/details/108680240
(2)ActivityRecord、TaskRecord、ActivityStack、ActivityDisplay、ActivityStackSupervisor到底是干嘛的?
https://blog.youkuaiyun.com/jiejingguo/article/details/100188576?utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-1.control
(3)Activity 启动流程log分析
https://blog.youkuaiyun.com/weixin_42695485/article/details/108632021
(4)android window和activity一些理解
https://blog.youkuaiyun.com/weixin_42695485/article/details/108876562