ImageLoader加载图片

来源:互联网 发布:dijkstra算法详解 编辑:程序博客网 时间:2024/06/16 06:07
    DisplayImageOptions imageOptions = new DisplayImageOptions.Builder()            .cacheOnDisk(true).cacheInMemory(true)            .showImageOnLoading(R.drawable.ic_launcher)            .showImageOnFail(R.drawable.ic_launcher).build();    int max = (int) (Runtime.getRuntime().maxMemory() / 8);    ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(            getApplicationContext())            .discCache(new UnlimitedDiskCache(getCacheDir()))            .memoryCache(new UsingFreqLimitedMemoryCache(max))            .threadPoolSize(3).threadPriority(Thread.NORM_PRIORITY - 1)            .defaultDisplayImageOptions(imageOptions).build();    ImageLoader.getInstance().init(configuration);
0 0