title: i want to retrieve firebase data in listview
body: <p>I wish to retrieve my firebase database data in list view in my <code>"notes"</code> Activity. I wrote some code but its not displaying the values.</p>
  
  <pre><code> private void viewAllNotes() {
  
          databaseReference = FirebaseDatabase.getInstance().getReference("Notes");
          databaseReference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
  
                  for(DataSnapshot postSnapshot : dataSnapshot.getChildren()){
                      spinnerData spinnerData = postSnapshot.getValue(spinnerData.class);
                      NotesList.add(spinnerData);
                  }
  
                  String [] Notes = new String[NotesList.size()];
  
                  for(int i=0;i&lt;Notes.length;i++){
  
                      Notes[i] = NotesList.get(i).getName();
                  }
  
                  final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(),android.R.layout.simple_list_item_1,Notes){
  
                      @Override
                      public View getView(int position, View convertView, ViewGroup parent) {
  
  
                          View view = super.getView(position, convertView, parent);
                          TextView myText = (TextView) view.findViewById(android.R.id.text1);
  
                          myText.setTextColor(Color.BLACK);
                          return view;
                      }
                  };
  
  
                  listViewNotes.setAdapter(adapter);
  
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
          });
      }
  </code></pre>
  
  <p>My database in firebase is like </p>
  
  <pre><code>Spinnerdata ----&gt; -Lnansd3ur3ufbu3bu3 ------&gt; name: tybsc com sci (etc)'
  </code></pre>
  
  <p>I want these in a list view in activity</p>