-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This comment bug occurs when we have multiple users commenting on a post
I think the root of the problem is this lines of code:
` private void getHandleName(final ViewHolder viewHolder) {
DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
Log.d(TAG, "getHandleName: checking comment userID" + viewHolder.comment.getUser_id());
Query query;
query = reference
.child("data")
.child("-Kxzyb5JsUPhsMQAb84X")
.child("users")
.orderByChild("user_id")
.equalTo(viewHolder.comment.getUser_id());
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot singleSnapshot : dataSnapshot.getChildren()) {
viewHolder.handleName.clearComposingText();
viewHolder.handleName.setText(singleSnapshot.getValue(User.class).getHandlename());
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}`
Metadata
Metadata
Assignees
Labels
No labels