Android的APP启动过程分析

aademeng · · 199 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

Android应用程序,以ActivityThread.main()做为主入口

下图展示了Application以及Activity的创建过程

 
1、创建Application
每个应用程序在第一次启动时,都会先创建一个Application对象。Application对象,是通过ActivityThread的handleBindApplication()创建的
Java代码  收藏代码
  1. private void handleBindApplication(AppBindData data) {  
  2.             Application app = data.info.makeApplication(data.restrictedBackupMode, null);//创建Application对象  
  3.             mInstrumentation.callApplicationOnCreate(app);//调用Application.onCreate  
  4.     }  


2、创建Activity
Activity对象,是通过ActivityThread的handleLaunchActivity()中的performLaunchActivity()创建的
Java代码  收藏代码
  1. private void handleLaunchActivity(ActivityClientRecord r, Intent customIntent) {  
  2.           
  3.         Activity a = performLaunchActivity(r, customIntent);  
  4.   
  5.         if (a != null) {  
  6.             r.createdConfig = new Configuration(mConfiguration);  
  7.             Bundle oldState = r.state;  
  8.             handleResumeActivity(r.token, false, r.isForward);  
  9. <pre class="java" name="code" style="font-size: 14px;"><span style="white-space: pre;">     </span>......</pre> } else { ...... } }  
  10. <pre></pre>  
  11. <pre></pre>  
Java代码  收藏代码
  1. private Activity performLaunchActivity(ActivityClientRecord r, Intent customIntent) {  
  2.         // System.out.println("##### [" + System.currentTimeMillis() + "] ActivityThread.performLaunchActivity(" + r + ")");  
  3.   
  4.         ActivityInfo aInfo = r.activityInfo;  
  5.         if (r.packageInfo == null) {  
  6.             r.packageInfo = getPackageInfo(aInfo.applicationInfo, r.compatInfo,  
  7.                     Context.CONTEXT_INCLUDE_CODE);  
  8.         }  
  9.   
  10.         ComponentName component = r.intent.getComponent();  
  11.         if (component == null) {  
  12.             component = r.intent.resolveActivity(  
  13.                 mInitialApplication.getPackageManager());  
  14.             r.intent.setComponent(component);  
  15.         }  
  16.   
  17.         if (r.activityInfo.targetActivity != null) {  
  18.             component = new ComponentName(r.activityInfo.packageName,  
  19.                     r.activityInfo.targetActivity);  
  20.         }  
  21.   
  22.         Activity activity = null;  
  23.         try {  
  24.             java.lang.ClassLoader cl = r.packageInfo.getClassLoader();  
  25.             activity = mInstrumentation.newActivity(  
  26.                     cl, component.getClassName(), r.intent);  
  27.             StrictMode.incrementExpectedActivityCount(activity.getClass());  
  28.             r.intent.setExtrasClassLoader(cl);  
  29.             if (r.state != null) {  
  30.                 r.state.setClassLoader(cl);  
  31.             }  
  32.         } catch (Exception e) {  
  33.             if (!mInstrumentation.onException(activity, e)) {  
  34.                 throw new RuntimeException(  
  35.                     "Unable to instantiate activity " + component  
  36.                     + ": " + e.toString(), e);  
  37.             }  
  38.         }  
  39.   
  40.         try {  
  41.             Application app = r.packageInfo.makeApplication(false, mInstrumentation);  
  42.   
  43.             if (localLOGV) Slog.v(TAG, "Performing launch of " + r);  
  44.             if (localLOGV) Slog.v(  
  45.                     TAG, r + ": app=" + app  
  46.                     + ", appName=" + app.getPackageName()  
  47.                     + ", pkg=" + r.packageInfo.getPackageName()  
  48.                     + ", comp=" + r.intent.getComponent().toShortString()  
  49.                     + ", dir=" + r.packageInfo.getAppDir());  
  50.   
  51.             if (activity != null) {  
  52.                 ContextImpl appContext = new ContextImpl();  
  53.                 appContext.init(r.packageInfo, r.token, this);  
  54.                 appContext.setOuterContext(activity);  
  55.                 CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager());  
  56.                 Configuration config = new Configuration(mCompatConfiguration);  
  57.                 if (DEBUG_CONFIGURATION) Slog.v(TAG, "Launching activity "  
  58.                         + r.activityInfo.name + " with config " + config);  
  59.                 activity.attach(appContext, this, getInstrumentation(), r.token,  
  60.                         r.ident, app, r.intent, r.activityInfo, title, r.parent,  
  61.                         r.embeddedID, r.lastNonConfigurationInstances, config);  
  62.   
  63.                 if (customIntent != null) {  
  64.                     activity.mIntent = customIntent;  
  65.                 }  
  66.                 r.lastNonConfigurationInstances = null;  
  67.                 activity.mStartedActivity = false;  
  68.                 int theme = r.activityInfo.getThemeResource();  
  69.                 if (theme != 0) {  
  70.                     activity.setTheme(theme);  
  71.                 }  
  72.   
  73.                 activity.mCalled = false;  
  74.                 mInstrumentation.callActivityOnCreate(activity, r.state);  
  75.                 if (!activity.mCalled) {  
  76.                     throw new SuperNotCalledException(  
  77.                         "Activity " + r.intent.getComponent().toShortString() +  
  78.                         " did not call through to super.onCreate()");  
  79.                 }  
  80.                 r.activity = activity;  
  81.                 r.stopped = true;  
  82.                 if (!r.activity.mFinished) {  
  83.                     activity.performStart();  
  84.                     r.stopped = false;  
  85.                 }  
  86.                 if (!r.activity.mFinished) {  
  87.                     if (r.state != null) {  
  88.                         mInstrumentation.callActivityOnRestoreInstanceState(activity, r.state);  
  89.                     }  
  90.                 }  
  91.                 if (!r.activity.mFinished) {  
  92.                     activity.mCalled = false;  
  93.                     mInstrumentation.callActivityOnPostCreate(activity, r.state);  
  94.                     if (!activity.mCalled) {  
  95.                         throw new SuperNotCalledException(  
  96.                             "Activity " + r.intent.getComponent().toShortString() +  
  97.                             " did not call through to super.onPostCreate()");  
  98.                     }  
  99.                 }  
  100.             }  
  101.             r.paused = true;  
  102.   
  103.             mActivities.put(r.token, r);  
  104.   
  105.         } catch (SuperNotCalledException e) {  
  106.             throw e;  
  107.   
  108.         } catch (Exception e) {  
  109.             if (!mInstrumentation.onException(activity, e)) {  
  110.                 throw new RuntimeException(  
  111.                     "Unable to start activity " + component  
  112.                     + ": " + e.toString(), e);  
  113.             }  
  114.         }  
  115.   
  116.         return activity;  
  117.     }  

根据文章刚开始描述应用启动过程的时序图,列出部分关键代码:
 
ActivityThread
主入口main
Java代码  收藏代码
  1. public static void main(String[] args) {  
  2.     Looper. prepareMainLooper();  
  3.     if ( sMainThreadHandler == null ) {  
  4.         sMainThreadHandler = new Handler();  
  5.     }  
  6.   
  7.     ActivityThread thread = new ActivityThread();  
  8.     thread.attach( false);  
  9.     
  10.     Looper.loop();  
  11. }  
Java代码  收藏代码
  1. private void attach( boolean system) {  
  2.     sThreadLocal.set( this );  
  3.     mSystemThread = system;  
  4.     if (!system) {  
  5.         IActivityManager mgr = ActivityManagerNative.getDefault();  
  6.         try {  
  7.             mgr.attachApplication( mAppThread );//mAppThread是一个ApplicationThread实例  
  8.         } catch (RemoteException ex) {  
  9.             // Ignore  
  10.         }  
  11.     } else {  
  12.         // Don't set application object here -- if the system crashes,  
  13.         // we can't display an alert, we just want to die die die.  
  14.     }  
  15. }  
Java代码  收藏代码
  1. public void handleMessage(Message msg) {  
  2.             if (DEBUG_MESSAGES) Slog.v(TAG, ">>> handling: " + codeToString(msg.what));  
  3.             switch (msg.what) {  
  4.                 case LAUNCH_ACTIVITY: {  
  5.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityStart");  
  6.                     ActivityClientRecord r = (ActivityClientRecord)msg.obj;  
  7.   
  8.                     r.packageInfo = getPackageInfoNoCheck(  
  9.                             r.activityInfo.applicationInfo, r.compatInfo);  
  10.                     handleLaunchActivity(r, null);  
  11.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  12.                 } break;  
  13.                 case RELAUNCH_ACTIVITY: {  
  14.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityRestart");  
  15.                     ActivityClientRecord r = (ActivityClientRecord)msg.obj;  
  16.                     handleRelaunchActivity(r);  
  17.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  18.                 } break;  
  19.                 case PAUSE_ACTIVITY:  
  20.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityPause");  
  21.                     handlePauseActivity((IBinder)msg.obj, false, msg.arg1 != 0, msg.arg2);  
  22.                     maybeSnapshot();  
  23.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  24.                     break;  
  25.                 case PAUSE_ACTIVITY_FINISHING:  
  26.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityPause");  
  27.                     handlePauseActivity((IBinder)msg.obj, true, msg.arg1 != 0, msg.arg2);  
  28.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  29.                     break;  
  30.                 case STOP_ACTIVITY_SHOW:  
  31.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityStop");  
  32.                     handleStopActivity((IBinder)msg.obj, true, msg.arg2);  
  33.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  34.                     break;  
  35.                 case STOP_ACTIVITY_HIDE:  
  36.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityStop");  
  37.                     handleStopActivity((IBinder)msg.obj, false, msg.arg2);  
  38.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  39.                     break;  
  40.                 case SHOW_WINDOW:  
  41.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityShowWindow");  
  42.                     handleWindowVisibility((IBinder)msg.obj, true);  
  43.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  44.                     break;  
  45.                 case HIDE_WINDOW:  
  46.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityHideWindow");  
  47.                     handleWindowVisibility((IBinder)msg.obj, false);  
  48.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  49.                     break;  
  50.                 case RESUME_ACTIVITY:  
  51.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityResume");  
  52.                     handleResumeActivity((IBinder)msg.obj, true,  
  53.                             msg.arg1 != 0);  
  54.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  55.                     break;  
  56.                 case SEND_RESULT:  
  57.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityDeliverResult");  
  58.                     handleSendResult((ResultData)msg.obj);  
  59.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  60.                     break;  
  61.                 case DESTROY_ACTIVITY:  
  62.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityDestroy");  
  63.                     handleDestroyActivity((IBinder)msg.obj, msg.arg1 != 0,  
  64.                             msg.arg2, false);  
  65.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  66.                     break;  
  67.                 case BIND_APPLICATION:  
  68.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "bindApplication");  
  69.                     AppBindData data = (AppBindData)msg.obj;  
  70.                     handleBindApplication(data);  
  71.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  72.                     break;  
  73.                 case EXIT_APPLICATION:  
  74.                     if (mInitialApplication != null) {  
  75.                         mInitialApplication.onTerminate();  
  76.                     }  
  77.                     Looper.myLooper().quit();  
  78.                     break;  
  79.                 case NEW_INTENT:  
  80.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityNewIntent");  
  81.                     handleNewIntent((NewIntentData)msg.obj);  
  82.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  83.                     break;  
  84.                 case RECEIVER:  
  85.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "broadcastReceiveComp");  
  86.                     handleReceiver((ReceiverData)msg.obj);  
  87.                     maybeSnapshot();  
  88.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  89.                     break;  
  90.                 case CREATE_SERVICE:  
  91.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "serviceCreate");  
  92.                     handleCreateService((CreateServiceData)msg.obj);  
  93.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  94.                     break;  
  95.                 case BIND_SERVICE:  
  96.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "serviceBind");  
  97.                     handleBindService((BindServiceData)msg.obj);  
  98.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  99.                     break;  
  100.                 case UNBIND_SERVICE:  
  101.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "serviceUnbind");  
  102.                     handleUnbindService((BindServiceData)msg.obj);  
  103.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  104.                     break;  
  105.                 case SERVICE_ARGS:  
  106.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "serviceStart");  
  107.                     handleServiceArgs((ServiceArgsData)msg.obj);  
  108.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  109.                     break;  
  110.                 case STOP_SERVICE:  
  111.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "serviceStop");  
  112.                     handleStopService((IBinder)msg.obj);  
  113.                     maybeSnapshot();  
  114.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  115.                     break;  
  116.                 case REQUEST_THUMBNAIL:  
  117.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "requestThumbnail");  
  118.                     handleRequestThumbnail((IBinder)msg.obj);  
  119.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  120.                     break;  
  121.                 case CONFIGURATION_CHANGED:  
  122.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "configChanged");  
  123.                     handleConfigurationChanged((Configuration)msg.obj, null);  
  124.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  125.                     break;  
  126.                 case CLEAN_UP_CONTEXT:  
  127.                     ContextCleanupInfo cci = (ContextCleanupInfo)msg.obj;  
  128.                     cci.context.performFinalCleanup(cci.who, cci.what);  
  129.                     break;  
  130.                 case GC_WHEN_IDLE:  
  131.                     scheduleGcIdler();  
  132.                     break;  
  133.                 case DUMP_SERVICE:  
  134.                     handleDumpService((DumpComponentInfo)msg.obj);  
  135.                     break;  
  136.                 case LOW_MEMORY:  
  137.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "lowMemory");  
  138.                     handleLowMemory();  
  139.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  140.                     break;  
  141.                 case ACTIVITY_CONFIGURATION_CHANGED:  
  142.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityConfigChanged");  
  143.                     handleActivityConfigurationChanged((IBinder)msg.obj);  
  144.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  145.                     break;  
  146.                 case PROFILER_CONTROL:  
  147.                     handleProfilerControl(msg.arg1 != 0, (ProfilerControlData)msg.obj, msg.arg2);  
  148.                     break;  
  149.                 case CREATE_BACKUP_AGENT:  
  150.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backupCreateAgent");  
  151.                     handleCreateBackupAgent((CreateBackupAgentData)msg.obj);  
  152.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  153.                     break;  
  154.                 case DESTROY_BACKUP_AGENT:  
  155.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backupDestroyAgent");  
  156.                     handleDestroyBackupAgent((CreateBackupAgentData)msg.obj);  
  157.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  158.                     break;  
  159.                 case SUICIDE:  
  160.                     Process.killProcess(Process.myPid());  
  161.                     break;  
  162.                 case REMOVE_PROVIDER:  
  163.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "providerRemove");  
  164.                     completeRemoveProvider((ProviderRefCount)msg.obj);  
  165.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  166.                     break;  
  167.                 case ENABLE_JIT:  
  168.                     ensureJitEnabled();  
  169.                     break;  
  170.                 case DISPATCH_PACKAGE_BROADCAST:  
  171.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "broadcastPackage");  
  172.                     handleDispatchPackageBroadcast(msg.arg1, (String[])msg.obj);  
  173.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  174.                     break;  
  175.                 case SCHEDULE_CRASH:  
  176.                     throw new RemoteServiceException((String)msg.obj);  
  177.                 case DUMP_HEAP:  
  178.                     handleDumpHeap(msg.arg1 != 0, (DumpHeapData)msg.obj);  
  179.                     break;  
  180.                 case DUMP_ACTIVITY:  
  181.                     handleDumpActivity((DumpComponentInfo)msg.obj);  
  182.                     break;  
  183.                 case DUMP_PROVIDER:  
  184.                     handleDumpProvider((DumpComponentInfo)msg.obj);  
  185.                     break;  
  186.                 case SLEEPING:  
  187.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "sleeping");  
  188.                     handleSleeping((IBinder)msg.obj, msg.arg1 != 0);  
  189.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  190.                     break;  
  191.                 case SET_CORE_SETTINGS:  
  192.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "setCoreSettings");  
  193.                     handleSetCoreSettings((Bundle) msg.obj);  
  194.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  195.                     break;  
  196.                 case UPDATE_PACKAGE_COMPATIBILITY_INFO:  
  197.                     handleUpdatePackageCompatibilityInfo((UpdateCompatibilityData)msg.obj);  
  198.                     break;  
  199.                 case TRIM_MEMORY:  
  200.                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "trimMemory");  
  201.                     handleTrimMemory(msg.arg1);  
  202.                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);  
  203.                     break;  
  204.                 case UNSTABLE_PROVIDER_DIED:  
  205.                     handleUnstableProviderDied((IBinder)msg.obj, false);  
  206.                     break;  
  207.             }  
  208.             if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + codeToString(msg.what));  
  209.         }  
Java代码  收藏代码
  1. public final void bindApplication(String processName,  
  2.                 ApplicationInfo appInfo, List<ProviderInfo> providers,  
  3.                 ComponentName instrumentationName, String profileFile,  
  4.                 ParcelFileDescriptor profileFd, boolean autoStopProfiler,  
  5.                 Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher,  
  6.                 int debugMode, boolean enableOpenGlTrace, boolean isRestrictedBackupMode,  
  7.                 boolean persistent, Configuration config, CompatibilityInfo compatInfo,  
  8.                 Map<String, IBinder> services, Bundle coreSettings) {  
  9.   
  10.             queueOrSendMessage(H.BIND_APPLICATION, data);  
  11.         }  




ActivityManagerService
Java代码  收藏代码
  1. private final boolean attachApplicationLocked(IApplicationThread thread,  
  2.         int pid) {     
  3.     ProcessRecord app;  
  4.     if (pid != MY_PID && pid >= 0) {  
  5.         synchronized (mPidsSelfLocked ) {  
  6.             app = mPidsSelfLocked .get(pid);  
  7.         }  
  8.     } else {  
  9.         app = null ;  
  10.     }  
  11.       
  12.   
  13.     try {         
  14.         thread.bindApplication(processName, appInfo, providers,  
  15.                 app. instrumentationClass , profileFile, profileFd, profileAutoStop,  
  16.                 app. instrumentationArguments , app.instrumentationWatcher , testMode,  
  17.                 enableOpenGlTrace, isRestrictedBackupMode || !normalMode, app.persistent ,  
  18.                 new Configuration(mConfiguration ), app. compat, getCommonServicesLocked(),  
  19.                 mCoreSettingsObserver .getCoreSettingsLocked());  
  20.         updateLruProcessLocked(app, false , true );  
  21.     } catch (Exception e) {  
  22.    
  23.     }  
  24.   
  25.     return true ;  
  26. }  
ActivityThread.ApplicationThread
Java代码  收藏代码
  1. public final void bindApplication(String processName,  
  2.                 ApplicationInfo appInfo, List<ProviderInfo> providers,  
  3.                 ComponentName instrumentationName, String profileFile,  
  4.                 ParcelFileDescriptor profileFd, boolean autoStopProfiler,  
  5.                 Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher,  
  6.                 int debugMode, boolean enableOpenGlTrace, boolean isRestrictedBackupMode,  
  7.                 boolean persistent, Configuration config, CompatibilityInfo compatInfo,  
  8.                 Map<String, IBinder> services, Bundle coreSettings) {  
  9.   
  10.             ......  
  11.             queueOrSendMessage(H.BIND_APPLICATION, data);  
  12.         }  

本文来自:博客园

感谢作者:aademeng

查看原文:Android的APP启动过程分析

199 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet