2014-01-16 83 views
0

我是编程的初学者,我想要做的就是编译我正在处理的这个简单的项目,但我仍然得到相同的错误,代码和错误日志如下。Android通用图像加载程序编译器错误

ImageGridActivity.java

.... 

imageLoader.displayImage(imageUrls[position], imageView, options, new ImageLoadingListener() { 
       @Override 
       public void onLoadingStarted() { 
        // do nothing 
       } 

       @Override 
       public void onLoadingFailed(FailReason failReason) { 
        imageView.setImageResource(android.R.drawable.ic_delete); 

        switch (failReason) { 
         case MEMORY_OVERFLOW: 
          imageLoader.clearMemoryCache(); 
          break; 
        } 
       } 

       @Override 
       public void onLoadingComplete() { 
        // do nothing 
       } 
      }); 

      return imageView; 
     } 
.... 

以下是错误日志。我正在使用Android Studio进行此项目。

GridViewerBro/BRO/src/main/java/com/example/bro/ImageGridActivity.java:97: error: no suitable method found for displayImage(String,ImageView,DisplayImageOptions,<anonymous com.nostra13.universalimageloader.core.ImageLoadingListener>) 
      imageLoader.displayImage(imageUrls[position], imageView, options, new ImageLoadingListener() { 
        ^
    method ImageLoader.displayImage(String,ImageView,DisplayImageOptions,ImageLoadingListener,ImageLoadingProgressListener) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageView,DisplayImageOptions,ImageLoadingListener) is not applicable 
     (actual argument <anonymous com.nostra13.universalimageloader.core.ImageLoadingListener> cannot be converted to ImageLoadingListener by method invocation conversion) 
    method ImageLoader.displayImage(String,ImageView,ImageLoadingListener) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageView,DisplayImageOptions) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageView) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageAware,DisplayImageOptions,ImageLoadingListener,ImageLoadingProgressListener) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageAware,DisplayImageOptions,ImageLoadingListener) is not applicable 
     (actual argument ImageView cannot be converted to ImageAware by method invocation conversion) 
    method ImageLoader.displayImage(String,ImageAware,DisplayImageOptions) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageAware,ImageLoadingListener) is not applicable 
     (actual and formal argument lists differ in length) 
    method ImageLoader.displayImage(String,ImageAware) is not applicable 
     (actual and formal argument lists differ in length) 

回答

0

从错误消息中,我们可以筛选出其他可能性。这是最接近的错误。

“方法ImageLoader.displayImage * (字符串,ImageView的,DisplayImageOptions,ImageLoadingListener) *是不适用(实际参数不能通过方法调用转换被转换为ImageLoadingListener)”

好像它是真正的投诉关于“com.nostra13.universalimageloader.core.ImageLoadingListener”

+0

我把它作为com.nostra13.universalimageloader.core.ImageLoadingListener – user3135837

+0

嗯,我仍然怀疑是这个问题。如果可能,你能告诉我可下载的链接吗?我知道github有这个项目,但ImageLoadingListener位于“核心/库”文件夹内而不是“核心”文件夹。 –

+0

它在这里https://github.com/nostra13/Android-Universal-Image-Loader – user3135837