读书人

Activity起动

发布时间: 2012-09-10 22:20:13 作者: rapoo

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此属性,只能用此方法,并回调。

读书人网 >移动开发

热点推荐