title: Retrieving child's Information from Firebase back to android studio
body: <p>I am new to Android Studio and Firebase itself. I understand that in order to get the child's data from its unique ID, I might need to use a Data Snapshot method. For example, I need to retrieve the <code>name</code> from Firebase database back to android studio application. How do I implement it in this case? Help would be much appreciated! </p>
  
  <pre><code>{
    "0Zs7aiWplRRJ5IJ5pazuUOxIdqz2" : {
  
      "name" : "yeo",
      "pos" : "intern",
      "team" : "nwrs"
    },
    "kaLCjJFoGETWCWH42kNkc90b5Ku1" : {
  
      "2016" : {
        "9" : {
      "25" : {
        ".priority" : 0.0,
        "AM" : "",
        "OT" : "",
        "OVN" : "",
        "PM" : "",
        "TPT" : ""
      }
        },
        "10" : {
      "1" : {
        ".priority" : 0.0,
        "AM" : "zxc11",
        "OT" : "12",
        "OVN" : "33",
        "PM" : "222",
        "TPT" : "54"
      },
      "26" : {
        "AM" : "aa",
        "OVN" : "gg",
        "PM" : "ccc",
        "TPT" : ""
      },
      "29" : {
        ".priority" : 0.0,
        "AM" : "dd",
        "OVN" : "aa",
        "PM" : "ss",
        "TPT" : "2fd"
      }
        }
      },
      "name" : "Jing Yang",
      "pos" : "Intern",
      "team" : "NWRS"
    }
  }
  </code></pre>
  
  <p>Below is my current code</p>
  
  <pre><code>    root.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              Set&lt;String&gt; set = new HashSet&lt;String&gt;();
              Iterator i = dataSnapshot.getChildren().iterator();
  
              while (i.hasNext()){
                  set.add(((DataSnapshot)i.next()).getKey());
  
              }
              names.clear();
              names.addAll(set);
  
              arrayAdapter.notifyDataSetChanged();
  </code></pre>