1public interface OnImageClickListener {
2 void onImageClick(String imageData);
3}
4MainActivity:
5
6public class MainActivity implements OnImageClickListener {
7 @Override
8 public void onImageClick(String imageData) {
9 // handle image data
10 }
11//...
12}
13Your VideoAdapter:
14
15 //...
16 private OnImageClickListener onImageClickListener;
17
18 public VideoAdapter(ArrayList<Video> data, ArrayList<Video> data2, Activity activity, OnImageClickListener onImageClickListener) {
19 this.mData = data;
20 this.mData2 = data2;
21 this.mACtivity = activity;
22 this.onImageClickListener = onImageClickListener;
23 }
24 //...
25 @Override
26 public void onBindViewHolder(VideoHolder holder, int position) {
27 //...
28 holder.restaurantImageView.setOnClickListener(new View.OnClickListener() {
29 @Override
30 public void onClick(View v) {
31 onImageClickListener.onImageClick(video2.getPic());
32 }
33 });
34 //...
35 }
36 //...