Recyclerview 的点击事件需要我们自己定义,我就做了一个自己定义的一个点击事件,主要看红色部分,红色部分是我自己写的点击事件,然后定义好点击事件
我们就可以去调用实现了,直接看代码吧
package com.xxx.text.adapter;
import android.content.Context;
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.nostra13.universalimageloader.core.ImageLoader;
import com.xxx.text.R;
import com.xxx.text.bean.Bean;
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyHolder> {
private Context context;
private Bean bean;
private OnItemClickListener mOnItemClickListener;
public MyAdapter(Context context, Bean bean) {
this.context = context;
this.bean = bean;
}
public interface OnItemClickListener{