频道栏目
首页 > 资讯 > 其他 > 正文

ImageLoaderConfig的MyApp用法

18-05-31        来源:[db:作者]  
收藏   我要投稿

ImageLoaderConfig的MyApp用法

public class MyApp extends Application {

private Context context;

@Override

public void onCreate() {

super.onCreate();

context = this;

File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/bawei");

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)

.diskCache(new UnlimitedDiskCache(file)) // default

.build();

ImageLoader.getInstance().init(config);

}

public static DisplayImageOptions getOptions() {

DisplayImageOptions options = new DisplayImageOptions.Builder()

.cacheInMemory(true) // default

.cacheOnDisk(true) // default

.build();

return options;

}

}

相关TAG标签
上一篇:jQuery对象与DOM对象之间的几种转换方法介绍
下一篇:HTML5的自定义data-*实现图片切换或者轮播(代码实例)
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站