View转化成bitmap保存成图片
Android中Activity启动过程探究
case LAUNCH_ACTIVITY: { final ActivityClientRecord r = (ActivityClientRecord) msg.obj; r.packageInfo = getPackageInfoNoCheck( r.activityInfo.applicationInfo, r.compatInfo); handleLaunchActivity(r, null, "LAUNCH_ACTIVITY");
private void handleLaunchActivity(ActivityClientRecord r, Intent customIntent, String reason) { Activity a = performLaunchActivity(r, customIntent); if (a != null) { r.createdConfig = new Configuration(mConfiguration); reportSizeConfigurations(r); Bundle oldState = r.state; handleResumeActivity(r.token, false, r.isForward, !r.activity.mFinished && !r.startsNotResumed, r.lastProcessedSeq, reason); } }
比较重要的两个方法 一个 performLaunchActivity(),另外一个是handleResumeActivity()。html
performLaunchActivity()中:app
attach( ) // 建立window 其与Activity的显示相关布局
onCreate(); // setContentView( ) 解析xml中view 并与decorview产生关联spa
handleResumeActivity()中:.net
执行activity中的onResume方法,将WindowManager将DecorView添加到Window中orm
将decorview添加到ViewRootImpl中,并有decorview执行测量、布局、绘制等操做。xml