public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
initImageLoader();
}
private void initImageLoader() {
//创建默认的ImageLoader配置参数
ImageLoaderConfiguration configuration = ImageLoaderConfiguration
.createDefault(this);
//Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(configuration);
}
public static DisplayImageOptions getOptions() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.cacheInMemory(true) // default
.cacheOnDisk(true) // default
.bitmapConfig(Bitmap.Config.RGB_565) // default
.displayer(new SimpleBitmapDisplayer()) // default
.handler(new Handler()) // default
.build();
return options;
}
}
@Override
public void onCreate() {
super.onCreate();
initImageLoader();
}
private void initImageLoader() {
//创建默认的ImageLoader配置参数
ImageLoaderConfiguration configuration = ImageLoaderConfiguration
.createDefault(this);
//Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(configuration);
}
public static DisplayImageOptions getOptions() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.cacheInMemory(true) // default
.cacheOnDisk(true) // default
.bitmapConfig(Bitmap.Config.RGB_565) // default
.displayer(new SimpleBitmapDisplayer()) // default
.handler(new Handler()) // default
.build();
return options;
}
}