> #### ActivityManagerService下的systemReady方法如下:
public void systemReady(final Runnable goingCallback) {
...
// 调用了ActivityStack中的resumeTopActivityLocked去启动Activity
mMainStack.resumeTopActivityLocked(null);
}
> #### ActivityStack中的resumeTopActivityLocked方法如下:
final boolean resumeTopActivityLocked(ActivityRecord prev) {
// 找到第一个当前没有关闭的Activity, 系统刚刚系统没有任何Activity执行, 所以next为null
ActivityRecord next = topRunningActivityLocked(null);
// Remember how we'll process this pause/resume situation, and ensure
// that the state is reset however we wind up proceeding.
final boolean userLeaving = mUserLeaving;
mUserLeaving = false;
if (next == null) {
// There are no more activities! Let's just start up the
// Launcher...
if (mMainStack) {
// 开启Launcher应用的第一个Activity界面.
return mService.startHomeActivityLocked();
}
}
}
> #### home界面显示, 这时Android系统启动完毕. 进入到待机画面.