imageLoader框架

来源:互联网 发布:nginx 查看模块 编辑:程序博客网 时间:2024/04/19 07:52

/**
 * 全局的上下文, app已启动运行的第一个上下文,也是全局的上下文
 * 配置一些 全局的 工具, 框架,等等(代码统计, 联网框架)
 * 当整个程序退出, 这个上下文才消亡;
 * 需要再清单文件中配置Application这个类--在资源文件Application标签下 android:name=".MApp"
 */

首先创建一个类,继承Application 切记在清单文件中配置Application这个类

重写Activity中的 OnCreate方法 在里面写一下内容

 //初始化imageLoader框架

        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)..build();//开始构建


//全局初始化此配置

ImageLoader.getInstance().init(config);