Fresco的注册和缓存

public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
//磁盘缓存的配置
DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(this)
.setBaseDirectoryPath(getCacheDir())
.setMaxCacheSize(8 * 1024 * 1024)
.build();

    //把磁盘缓存的设置,设置到三级缓存中
    ImagePipelineConfig pipelineConfig = ImagePipelineConfig.newBuilder(this)
            .setMainDiskCacheConfig(diskCacheConfig)
            .build();

    Fresco.initialize(this);
}

}

你可能感兴趣的:(Fresco的注册和缓存)