java.lang.IllegalStateException:在使用之前,ImageLoader必须是带配置的init

cra*_*her 2 android universal-image-loader

我的应用程序使用Universal ImageLoader,现在正在生产中.我安装了bugsense(MINT)并报告了这个错误.我已经在应用程序类中初始化了ImageLoader但是某种程度上应用程序实例已经死了,而且活动仍在尝试使用这个库onResume.任何帮助,将不胜感激.

这是应用程序类中的初始化代码.

DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
        .cacheInMemory(true)
        .cacheOnDisk(true)
        .imageScaleType(ImageScaleType.EXACTLY)
        .build();

    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
    .writeDebugLogs()
    .defaultDisplayImageOptions(defaultOptions)
    .diskCacheExtraOptions(480, 320, null)
    .build();
    ImageLoader.getInstance().init(config);
Run Code Online (Sandbox Code Playgroud)

Pgm*_*eek 5

你可以试试init吗? ImageLoaderConfiguration

protected ImageLoader imageLoader;

imageLoader = ImageLoader.getInstance();
imageLoader.init(ImageLoaderConfiguration.createDefault(this));
Run Code Online (Sandbox Code Playgroud)