无法解析符号'picassoclient'android [英] Cannot resolve symbol 'picassoclient' android

查看:74
本文介绍了无法解析符号'picassoclient'android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用RSS提要处理新闻android项目,我的应用程序现在可以完美地获取标题,描述,新闻时间,但它来到图像它显示以下错误:

无法解析符号'PicassoClient'



我的代码:

公共类MyAdapter扩展了RecyclerView。适配器及LT; MyViewHolder> {

背景c;
ArrayList<文章>文章;

public MyAdapter(Context c,ArrayList< Article> articles){
this.c = c;
this.articles = articles;
}

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
View v = LayoutInflater.from(c).inflate(R.layout。模型,父母,假);
返回新的MyViewHolder(v);
}

@Override
public void onBindViewHolder(MyViewHolder holder,int position){

Article article = articles.get(position);

String title = article.getTitle();
String desc = article.getDescription();
String date = article.getDate();
String imageUrl = article.getImageUrl()。replace(localhost,10.0.2.2);

holder.titleTxt.setText(title);
holder.desctxt.setText(desc.substring(0,130));
holder.dateTxt.setText(date);
PicassoClient.downloadImage(c,imageUrl,holder.img);

}

@Override
public int getItemCount(){
return articles.size();
}
}



这是我的依赖项:

依赖项{
编译fileTree(包括:['* .jar'],dir:'libs')
testCompile'junit:junit:4.12'
//编译项目(':picasso-2.5.2')
编译'com.squareup.picasso:picasso:2.5.2'
编译'com.android.support:appcompat-v7:23.2.1'
编译'com.android.support:design :23.2.1'
compile'c​​om.android.support:cardview-v7:23.2.1'
}





我的尝试:



编译'com.squareup.picasso:picasso:2.5.0版

我不知道该怎么办!!

解决方案

PicassoClient 不属于< a href =http://square.github.io/picasso/>毕加索 [ ^ ]库。



看起来你从某个地方复制了代码而忘了复制 PicassoClient 实现。

I'm working on news android project using RSS feed, my app now can get title, description, time of news perfectly but one it come to image it shows me the following error:

Cannot resolve symbol 'PicassoClient'


this my code :

public class MyAdapter extends RecyclerView.Adapter<MyViewHolder> {

    Context c;
    ArrayList<Article> articles;

    public MyAdapter(Context c, ArrayList<Article> articles) {
        this.c = c;
        this.articles = articles;
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v= LayoutInflater.from(c).inflate(R.layout.model,parent,false);
        return new MyViewHolder(v);
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {

        Article article=articles.get(position);

        String title=article.getTitle();
        String desc=article.getDescription();
        String date=article.getDate();
        String imageUrl=article.getImageUrl().replace("localhost","10.0.2.2");

        holder.titleTxt.setText(title);
        holder.desctxt.setText(desc.substring(0,130));
        holder.dateTxt.setText(date);
        PicassoClient.downloadImage(c,imageUrl,holder.img);

    }

    @Override
    public int getItemCount() {
        return articles.size();
    }
}


this is my dependencies:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    // compile project(':picasso-2.5.2')
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.android.support:cardview-v7:23.2.1'
}



What I have tried:

compile 'com.squareup.picasso:picasso:2.5.0 version
I don't know what to do !!

解决方案

PicassoClient is not part of the Picasso[^] library.

It looks like you have copied code from somewhere and forgot to copy the PicassoClient implementation as well.


这篇关于无法解析符号'picassoclient'android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆