TuchongApplication.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:tuchong-daily-android 作者:
public void setPicasso() {
    OkHttpClient client = new OkHttpClient();
    client.networkInterceptors().add(new StethoInterceptor());
    File cache = new File(this.getCacheDir(), PICASSO_CACHE);
    if (!cache.exists()) {
        //noinspection ResultOfMethodCallIgnored
        cache.mkdirs();
    }
    try {
        client.setCache(new Cache(cache, PICASSO_CACHE_SIZE));
    } catch (IOException e) {
        e.printStackTrace();
    }
    Picasso picasso = new Picasso.Builder(this)
            .downloader(new OkHttpDownloader(client))
            .build();
    Picasso.setSingletonInstance(picasso);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号