title: Firebase - check if uid child values match in Posts node,if so then add all score values together and store in String variable
body: <p>I want to check if there are <code>uid</code> child values are matching in the Posts node,if so then I want to add all the respective <code>score</code> values together and store in a String variable.</p>
  
  <p>Below there is my firebase structure </p>
  
  <p>this is my code... i want to get the total score to a string variable and set the text in here...."holder.score.setText(Score);"</p>
  
  <pre><code>private void DisplayAllUserScores() {
      //do... TotalPicScore &amp; PostImage
      FirebaseRecyclerOptions&lt;Leaderboard&gt; options =
              new FirebaseRecyclerOptions.Builder&lt;Leaderboard&gt;()
                      .setQuery(LikesRef, Leaderboard.class)
                      .build();
      FirebaseRecyclerAdapter&lt;Leaderboard, LeaderboardActivity.ScoresViewHolder&gt; firebaseRecyclerAdapter =
              new FirebaseRecyclerAdapter&lt;Leaderboard, LeaderboardActivity.ScoresViewHolder&gt;(options) {
                  @Override
                  protected void onBindViewHolder(@NonNull final LeaderboardActivity.ScoresViewHolder holder, int position, @NonNull final Leaderboard model) {
                      final String scores_id = getRef(position).getKey();
                      PostsRef.child(scores_id).addValueEventListener(new ValueEventListener() {
                          @Override
                          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                              if (dataSnapshot.exists()) {
                                  final String userName = dataSnapshot.child("fullname").getValue().toString();
                                  final String Score = dataSnapshot.child("score").getValue().toString();
                                  final String userprofileimage = dataSnapshot.child("profileimage").getValue().toString();
  
  
                                  //GetUserInformation();
  
                                  holder.leaderboardUsernames.setText(userName);
                                  holder.score.setText(Score);
                                  Picasso.get().load(userprofileimage).placeholder(R.drawable.profile).into(holder.leaderboardProfilepicture);
                              }
                          }
  
                          @Override
                          public void onCancelled(@NonNull DatabaseError databaseError) {
                          }
                      });
                  }
  
                  @NonNull
                  @Override
                  public LeaderboardActivity.ScoresViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
                      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.all_users_scores_layout, parent, false);
                      ScoresViewHolder viewHolder = new ScoresViewHolder(view);
                      return viewHolder;
                  }
              };
      ScoreList.setAdapter(firebaseRecyclerAdapter);
      firebaseRecyclerAdapter.startListening();
  }
  </code></pre>