配置全局变量application imageloader框架

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //配置属性
        DisplayImageOptions options = new DisplayImageOptions.Builder() .build();
        //设置imageloader
        ImageLoaderConfiguration loader = new ImageLoaderConfiguration.Builder(this)
                .defaultDisplayImageOptions(options)//设置配置属性
                .build();

        //        获得实例
        ImageLoader imageLoader = ImageLoader.getInstance();
//        初始化
        imageLoader.init(loader);
    }
}

猜你喜欢

转载自blog.csdn.net/qq_43413640/article/details/85332283