在recyclerview中无法从毕加索加载图像?

时间:2016-05-13 10:44:03

标签: android android-recyclerview picasso

我无法在recyclerview中通过picasso从互联网上下载图像,我的代码中没有出现问题这是我的代码。

MainActivity: -

package bunk.hp.testrecycleview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    RecyclerView rv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        rv=(RecyclerView) findViewById(R.id.rv);

        LinearLayoutManager llm = new LinearLayoutManager(this);
        rv.setLayoutManager(llm);

        List<people> people;
        people = new ArrayList<>();
        people.add(new people("event 1","http://www.neostat.esy.es/images/images/dc9caf3b77251095a29fd0c19a575303.png"));
        people.add(new people("event 2","http://www.neostat.esy.es/images/images/c5e95b55fba01399d6d7f81d8cb88007.png"));
        people.add(new people("event 1","http://www.neostat.esy.es/images/images/bce9e7e336449297394709ae0144139c.png"));
        people.add(new people("event 1","http://www.neostat.esy.es/images/images/77ff90154a4c2b1430d5bf750ed7ad62.png"));
        people.add(new people("event 1","http://www.neostat.esy.es/images/images/6e9d910c75468c4da89f72ddb62ff4b6.png"));

        myadapter adapter = new myadapter(people);
        rv.setAdapter(adapter);

    }
}

myadapter: -

package bunk.hp.testrecycleview;

import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import org.w3c.dom.Text;

import java.util.List;

/**
 * Created by cheta on 5/13/2016.
 */
public class myadapter extends RecyclerView.Adapter<myadapter.personholder>
{

    List<people> people;

    myadapter(List<people> people)
    {
        this.people =people;

    }
    @Override
    public personholder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.cardview,parent,false);
        personholder pvh = new personholder(v);
        return pvh;

    }

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

        holder.text.setText(people.get(position).title);
        Context context = holder.img.getContext();
        Picasso.with(context).load(people.get(position).title).into(holder.img);
    }

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

    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        super.onAttachedToRecyclerView(recyclerView);
    }


    public static class personholder extends RecyclerView.ViewHolder{

        ImageView img;
        CardView card;
        TextView text;

         personholder(View v)
        {
            super(v);
            img = (ImageView) v.findViewById(R.id.image);
            card = (CardView) v.findViewById(R.id.view);
            text = (TextView) v.findViewById(R.id.text);


        }
     }
}

人: -

package bunk.hp.testrecycleview;

import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by cheta on 5/13/2016.
 */
public class people  {

    String title;
    String image;

    public people(String title,String image)
    {
        this.title=title;
        this.image=image;

    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }
}

activity_main.xml中: -

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="bunk.hp.testrecycleview.MainActivity"

    >

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/rv"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"

        />
</RelativeLayout>

cardview: -

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/view">

        <ImageView
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:id="@+id/image"

            />


    </android.support.v7.widget.CardView>

    <TextView
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:id="@+id/text"
        android:layout_gravity="center"
        android:text="Title"
        android:textSize="30dp"

        android:layout_marginEnd="48dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true" />


</RelativeLayout>

以下是日志: -

05-13 15:55:29.024 8088-8088/bunk.hp.testrecycleview D/OpenGLRenderer: Enabling debug mode 0
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 657: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 659: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-13 15:55:29.044 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isUpdated ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isUpdated, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15304: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isUpdated ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0031
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.flagRemovedAndOffsetPosition (IIZ)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.flagRemovedAndOffsetPosition, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15288: Landroid/support/v7/widget/RecyclerView$ViewHolder;.flagRemovedAndOffsetPosition (IIZ)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0053
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isRemoved ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isRemoved, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15301: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isRemoved ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0058
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearPayload ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.clearPayload, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15283: Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearPayload ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x007c
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isAdapterPositionUnknown ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isAdapterPositionUnknown, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15297: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isAdapterPositionUnknown ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0086
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.offsetPosition (IZ)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.offsetPosition, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15306: Landroid/support/v7/widget/RecyclerView$ViewHolder;.offsetPosition (IZ)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x00ad
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.shouldIgnore ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.shouldIgnore, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15315: Landroid/support/v7/widget/RecyclerView$ViewHolder;.shouldIgnore ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x00b9
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.setFlags (II)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.setFlags, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15311: Landroid/support/v7/widget/RecyclerView$ViewHolder;.setFlags (II)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x00d4
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.addChangePayload (Ljava/lang/Object;)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.addChangePayload, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15280: Landroid/support/v7/widget/RecyclerView$ViewHolder;.addChangePayload (Ljava/lang/Object;)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x00dc
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isBound ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isBound, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15298: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isBound ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x00f0
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.hasAnyOfTheFlags (I)Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.hasAnyOfTheFlags, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15296: Landroid/support/v7/widget/RecyclerView$ViewHolder;.hasAnyOfTheFlags (I)Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x011a
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearTmpDetachFlag ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.clearTmpDetachFlag, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15285: Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearTmpDetachFlag ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0125
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.needsUpdate ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.needsUpdate, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15305: Landroid/support/v7/widget/RecyclerView$ViewHolder;.needsUpdate ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x012b
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearOldPosition ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.clearOldPosition, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15282: Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearOldPosition ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0136
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearReturnedFromScrapFlag ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.clearReturnedFromScrapFlag, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15284: Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearReturnedFromScrapFlag ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x013c
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.saveOldPosition ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.saveOldPosition, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15310: Landroid/support/v7/widget/RecyclerView$ViewHolder;.saveOldPosition ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0142
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isScrap ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isScrap, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15302: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isScrap ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0148
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.addFlags (I)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.addFlags, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15281: Landroid/support/v7/widget/RecyclerView$ViewHolder;.addFlags (I)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x015b
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.wasReturnedFromScrap ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.wasReturnedFromScrap, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15319: Landroid/support/v7/widget/RecyclerView$ViewHolder;.wasReturnedFromScrap ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0177
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.getUnmodifiedPayloads ()Ljava/util/List; from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.getUnmodifiedPayloads, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15295: Landroid/support/v7/widget/RecyclerView$ViewHolder;.getUnmodifiedPayloads ()Ljava/util/List;
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x0182
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.stopIgnoring ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.stopIgnoring, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15316: Landroid/support/v7/widget/RecyclerView$ViewHolder;.stopIgnoring ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01b4
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isTmpDetached ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isTmpDetached, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15303: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isTmpDetached ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01c7
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isInvalid ()Z from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isInvalid, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15299: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isInvalid ()Z
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01d2
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.setScrapContainer (Landroid/support/v7/widget/RecyclerView$Recycler;Z)V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.setScrapContainer, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15313: Landroid/support/v7/widget/RecyclerView$ViewHolder;.setScrapContainer (Landroid/support/v7/widget/RecyclerView$Recycler;Z)V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01ef
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.resetInternal ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.resetInternal, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15309: Landroid/support/v7/widget/RecyclerView$ViewHolder;.resetInternal ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01f5
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.unScrap ()V from Lbunk/hp/testrecycleview/myadapter$personholder;)
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.unScrap, referenced from method bunk.hp.testrecycleview.myadapter$personholder.access$super
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/dalvikvm: VFY: unable to resolve virtual method 15318: Landroid/support/v7/widget/RecyclerView$ViewHolder;.unScrap ()V
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview D/dalvikvm: VFY: replacing opcode 0x6f at 0x01fb
05-13 15:55:29.054 8088-8088/bunk.hp.testrecycleview W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
05-13 15:56:10.054 8088-8088/bunk.hp.testrecycleview E/OpenGLRenderer: SFEffectCache:clear(), mSize = 0

3 个答案:

答案 0 :(得分:1)

您应该在代码中更改此行:

Picasso.with(context).load(people.get(position).title).into(holder.img);

Picasso.with(context).load(people.get(position).image).into(holder.img);

你传递的图像标题而不是毕加索的图像路径。

答案 1 :(得分:1)

  

您正在title image.Load取代PicassoPicasso.with(context).load(people.get(position).image).into(holder.img); 无法识别为图片。

更改为此。

getDefaultInstance

答案 2 :(得分:1)

使用

Picasso.with(context).load(people.get(position).image).into(holder.img);

您正在加载标题而不是图片。