0

Metric All post. I have a social media app project, and I want to detect and count the number of user who view the specific post/item in a recyclerView. Hope you have any idea about this. Thank you!

JonathanDevs
  • 1
  • 1
  • 3

1 Answers1

0

put count in your model class

int readCount

Like

class MyAdapterModelClass {
......
int readCount
......

void incrementReadCount(){
readCount++;
}
}

onBindViewHolder(position, holder){
items.get(position).incrementReadCount();
}
Muhammad Ahmed
  • 1,038
  • 1
  • 7
  • 7