Android recyclerview: How to implement asynchronous listeners?
I have this code:
@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) {
...
String username = ...;
addListenerForTyping(() -> holder.myTextView.setText(username + " is typing..."));
...
}
This doesn't work well. There are many items in my list, and when I scroll through them all, while a user is typing, the typing-text will be shown for the wrong item. Not for the item that actually belongs to the typing user.
I guess the reason is...