title: Dynamically add TextViews to a leaderboard screen
body: <p>I have a leaderboard screen in my app where i want to add each users score. 
  So far I have been able to retrieve the scores from the the database but I want to show these scores on a leaderboard screen. </p>
  
  <p>I have this code, but the for loop sets the text of the textView and instead of each score being displayed, only the last score of the loop is displayed. Is there anyway to not overwrite the textView and instead have multiple textViews created and displayed?</p>
  
  <pre><code>package com.example.securityapp;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.nfc.Tag;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;
  
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.Query;
  import com.google.firebase.database.ValueEventListener;
  
  import static java.lang.System.in;
  
  public class leaderboard extends AppCompatActivity {
  
      DatabaseReference databaseUsers;
      FirebaseDatabase database = FirebaseDatabase.getInstance();
      FirebaseAuth mAuth;
      TextView score;
      private static final String TAG = "leaderboard";
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_leaderboard);
  
          mAuth = FirebaseAuth.getInstance();
          FirebaseUser user = mAuth.getCurrentUser();
          score = (TextView) findViewById(R.id.tableText);
  
  
          database.getReference().child("Scores").addValueEventListener(new ValueEventListener() {
              public void onDataChange(DataSnapshot dataSnapshot) {
                  for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                          System.out.println("The score is: " + snapshot.toString());
                          score.setText(snapshot.toString());
                      }
                  }
  
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
               // Getting Post failed, log a message
               Log.w(TAG, "loadPost:onCancelled", databaseError.toException());
  
      }
  
  
  });
  
          }
  }
  </code></pre>