简体   繁体   English

Android Universal Image Loader编译器错误

[英]Android Universal Image Loader Compiler Error

I'm a beginner in programing and all i want to do is compile this simple project I'm working on but I continue to get this same error, the code and error log are below. 我是编程的初学者,我要做的就是编译我正在处理的这个简单项目,但是我仍然遇到同样的错误,下面是代码和错误日志。

ImageGridActivity.java 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;
        }
....

Here is the error log. 这是错误日志。 I'm using Android Studio for this project. 我正在为此项目使用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)

From the error messages, we can filter out other possibilities. 从错误消息中,我们可以过滤掉其他可能性。 And this is the most closest error. 这是最接近的错误。

"method ImageLoader.displayImage* (String,ImageView,DisplayImageOptions,ImageLoadingListener) * is not applicable (actual argument cannot be converted to ImageLoadingListener by method invocation conversion )" “方法ImageLoader.displayImage * (String,ImageView,DisplayImageOptions,ImageLoadingListener) *不适用( 不能通过方法调用转换将实际参数转换为ImageLoadingListener )”

Seems it is really complaints about "com.nostra13.universalimageloader.core.ImageLoadingListener" 似乎确实是有关“ com.nostra13.universalimageloader.core.ImageLoadingListener”的投诉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM