Why this Error occurred? java.lang.RuntimeException: ImageLoader must be init with configuration before using

后端 未结 2 1905
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 08:31

I have downloaded one ImageDownloader code from gitHub(from Here) Now when I am trying to download the image from my webservice I am getting this Runtime Exception \"ImageLo

相关标签:
2条回答
  • 2021-01-04 09:03

    I have added this line in my Constructor and its worked for me...

    imageLoader.init(ImageLoaderConfiguration.createDefault(context));
    
    0 讨论(0)
  • 2021-01-04 09:26
    protected ImageLoader imageLoader;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    imageLoader = ImageLoader.getInstance();
    imageLoader.init(ImageLoaderConfiguration.createDefault(this));
    
    0 讨论(0)
提交回复
热议问题