title: Populate textView from firebase database
body: <p>I am trying to populate a TextView from a firebase database. Here is the sample json file.</p>
  
  <pre><code>{
   "Player" : {
    "Club" : "Valley Rovers",
    "Name" : "John Murphy"
   }
  }
  </code></pre>
  
  <p>Here is my android code:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  private   TextView mPlayer;
  private DatabaseReference mDatabase;
  
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      mPlayer = (TextView) findViewById(R.id.player);;
  
      mDatabase = FirebaseDatabase.getInstance().getReference("Player").child("Name");
  
      final String player = mDatabase.push().getKey();
  
      mDatabase.child("Name").addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
  
              // Check for null
              if (player == null) {
                  Log.e(TAG, "User data is null!");
                  return;
              }
  
  
  
  
              mPlayer.setText(player);
  
  
  
  
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  
  }
  </code></pre>
  
  <p>I want to add the name John Murphy to the firebase database and doing so the TextView mPlayer will populate with John Murphy.</p>