Activity启动
每个Activity的创建,都会执行到ActivityThread类中的
Activity performLaunchActivity(ActivityClientRecord r, Intent customIntent) 此类负责创建Activity实例和一些information。并回调一些Activity 的回调函数 onXXX().
其中调用了 activity.attach(*******)。
下面是创建WindowManger/** * Specify custom window attributes. <strong>PLEASE NOTE:</strong> the * layout params you give here should generally be from values previously * retrieved with {@link #getAttributes()}; you probably do not want to * blindly create and apply your own, since this will blow away any values * set by the framework that you are not interested in. * * @param a The new window attributes, which will completely override any * current values. */ public void setAttributes(WindowManager.LayoutParams a) { mWindowAttributes.copyFrom(a); if (mCallback != null) { mCallback.onWindowAttributesChanged(mWindowAttributes); } }
要更改mWindowAttributes此属性,只能用此方法,并回调。