首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

Activity起动

2012-09-10 
Activity启动每个Activity的创建,都会执行到ActivityThread类中的Activity performLaunchActivity(Activit

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

热点排行