I have implemented onClick listener to my ViewHolder for my RecyclerView
But when I perform very fast double taps or mouse clicks, it performs the task (opens a seperate
boolean canStart = true;
ViewHolder.dataText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (canStart) {
canStart = false; // do canStart false
// Whatever you want to do and not have run twice due to double tap
}
}
}
public void setCanStart(boolean can){
canStart = can;
}
@Override
public void onResume() {
super.onResume();
mAdapter.setCanStart(true);
}
Hope it will help :)