title: How do I get names of children from Firebase to listview Android?
body: <p>I am new to working with Firebase. How do I get the names of the children from my Firebase to a listview?</p>
  
  <p><img src="https://i.stack.imgur.com/f0AZ3.png" alt="Enter image description here"></p>
  
  <p>Here is my database:</p>
  
  <p><img src="https://i.stack.imgur.com/atE8C.png" alt="Enter image description here"></p>
  
  <p>Here is my code, but it does not work.</p>
  
  <pre><code>public class Education extends AppCompatActivity {
  
      private DatabaseReference fNotesDatabase;
      ListView listView;
      ArrayList&lt;String&gt; arraylist = new ArrayList&lt;&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_education);
  
          Firebase.setAndroidContext(this);
          fNotesDatabase = FirebaseDatabase.getInstance().getReference().child("Notes").child("education").child();
          listView = (ListView) findViewById(R.id.listview);
          final ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, arraylist);
  
          listView.setAdapter(arrayAdapter);
  
          fNotesDatabase.addChildEventListener(new ChildEventListener() {
              @Override
              public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                  Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
                  arraylist.add(map.values().toString());
                  arrayAdapter.notifyDataSetChanged();
              }
  
              @Override
              public void onChildChanged(DataSnapshot dataSnapshot, String s) {
                  Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
                  arraylist.add(map.values().toString());
              }
  
              @Override
              public void onChildRemoved(DataSnapshot dataSnapshot) {
  
              }
  
              @Override
              public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
      }
  }
  </code></pre>