快速回答:
public CustomViewHolder(View view) { super(view); this.imageView = (ImageView) view.findViewById(R.id.imglayout); this.textView = (TextView) view.findViewById(R.id.namelayout); customViewHolder.textView.setOnClickListener(new OnClickListener(){ public void onClick(View view){ // Make your toast here, and for the text, use ((TextView) view).getText().toString() } }) }
但我建议你去看看 bind() 方法 ViewHolder 被召唤 onBindViewHolder
bind()
ViewHolder
onBindViewHolder