Title: recycler view, not scrolling when using an on click listener onto the whole itemview
Tags: android;android-recyclerview;scroll;onclicklistener
Question: I want to use an on click listener onto the whole recycler view item. well, I want to use the on click listener when clicking on the item &quot;anywhere&quot; (the whole item). but when the whole item is using an on click listener, as you can see, the click listener is preventing the scrolling. how can i use an on click listener onto the whole item in the recycler, but scrolling should still be possible. i used the systems itemview for the click listener, also a button over the whole item layout, anyway the click listener prevents from scrolling. how to solve this? Thanks! Here the code:
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView tvBezeichnung;
public ImageButton buttonSelect;
public ImageButton buttonUpDown;
public ViewHolder(View itemView) {
super(itemView);
tvBezeichnung = itemView.findViewById(R.id.risftvbezeichnung);

itemview.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
...
});
//also tried buttons/other views over the whole item, on click listener prevents scrolling
}
Comment: There must be something else not in your shared snippet that causes this.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:01/07/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<android><android-recyclerview><scroll><onclicklistener>', 'Title': 'recycler view, not scrolling when using an on click listener onto the whole itemview', 'ViewCount': 154, 'id': 65614034, 'user_AboutMe': None, 'user_AccountId': 18815241.0, 'user_DisplayName': 'Maximilian Notar', 'user_Reputation': 21.0, 'user_Views': 5.0, 'user_id': 13722549.0}}