Reputation: 102
i am using data binding recycler view .i want to get that clicked position and show that position id(image) in view pager.i created data binding XML for image.
Upvotes: 0
Views: 1162
Reputation: 5371
Position of clicked view does not matter, because views reused again and again while you scrolling content. You can directly set EventLisener to ViewHolder at onBindViewHolder(final ViewHolder holder, int position)
method of RecyclerView.Adapter class
Upvotes: 1