internal void attach (Context context, Application application, Window window) { mApplication = application; mWindow = window; attachBaseContext (context); mFragments.attachActivity (this); mWindow.setCallback (this); }
internal ActivityThread () { sThreadLocal.set (this); mSystemThread = true; mInstrumentation = new Instrumentation (); ContextImpl context = new ContextImpl (); context.init (getSystemContext ().mPackageInfo, null, this); var res = context.getResources (); mConfiguration = res.getConfiguration (); XobotActivityManager.DeviceConfig.updateConfig (mConfiguration); res.updateConfiguration (mConfiguration, res.getDisplayMetrics ()); applyConfigurationToResourcesLocked (mConfiguration, mResCompatibilityInfo); applyCompatConfiguration (); Application app = new Application (); app.attach (context); mAllApplications.add (app); mInitialApplication = app; app.onCreate (); }