вот метод, который я использую, чтобы получить позицию предметов для рециркулятора и выполнить точное действие с:
@Override
public void onItemClicked(RecyclerView recyclerView, int position, View v) {
}
Я поместил кнопку image в файл, который раздувает мое представление о переработчике, как показано на этом рисунке:

моя кнопка images находится в активности, которая воспроизводит видео, как показано на этом рисунке.
[![образ]
вот мой адаптер:
public class Adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private Context context;
private LayoutInflater inflater;
private List<Data> data= Collections.emptyList();
Data current;
private int currentPos=0;
// create constructor to innitilize context and data sent from MainActivity
public Adapter(Context context, List<Data> data){
this.context=context;
inflater= LayoutInflater.from(context);
this.data=data;
}
// Inflate the layout when viewholder created
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view=inflater.inflate(R.layout.container, parent,false);
MyHolder holder=new MyHolder(view);
return holder;
}
// Bind data
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
// Obtenir la position actuelle de l'élément dans recyclerview pour lier les données et affecter des valeurs à partir de la liste
MyHolder myHolder= (MyHolder) holder;
Data current = data.get(position);
myHolder.textFishName.setText(current.catName);
myHolder.textSize.setText(current.sizeName);
myHolder.textSize.setVisibility(View.GONE);
myHolder.textType.setText(current.fishName);
myHolder.id.setText(""+current.idServer+"");
myHolder.textPrice.setText("" + current.price + "");
myHolder.textPrice.setVisibility(View.GONE);
myHolder.textPrice.setTextColor(ContextCompat.getColor(context, R.color.colorAccent));
// load image into imageview using glide
Glide.with(context).load("http://192.168.43.196/vibe2/images/" + current.fishImage)
.placeholder(R.drawable.ic_menu_camera)
.error(R.drawable.ic_menu_camera)
.into(myHolder.ivFish);
}
// return total item from List
@Override
public int getItemCount() {
return data.size();
}
class MyHolder extends RecyclerView.ViewHolder {
TextView textFishName;
ImageView ivFish;
TextView textSize;
TextView textType;
TextView textPrice;
TextView counter;
TextView id;
// create constructor to get widget reference
public MyHolder(View itemView) {
super(itemView);
textFishName = itemView.findViewById(R.id.textFishName);
ivFish = itemView.findViewById(R.id.ivFish);
textSize = itemView.findViewById(R.id.textSize);
textType = itemView.findViewById(R.id.textType);
textPrice = itemView.findViewById(R.id.textPrice);
counter = itemView.findViewById(R.id.counter);
id = itemView.findViewById(R.id.id);
}
}
}