title: Android Firebase getKey() returning child instead
body: <p>I have a Firebase database that looks like this:</p>
  
  <pre><code>appname:
    chat:
      [ID]:
        child1:value
        child2:value
  </code></pre>
  
  <p>I'm querying it like this:</p>
  
  <pre><code>DatabaseReference ref = rootReference.child("chat").child([ID]);
  ref.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
      if (dataSnapshot.exists()) {
        long index = Long.parseLong(dataSnapshot.getKey());
      }
    }
  </code></pre>
  
  <p>The problem is, this query doesn't work because <code>dataSnapshot.getKey()</code> returns "child1" instead of the ID. It does the same thing for <code>dataSnapshot.getRef().getKey()</code>. If I use <code>dataSnapshot.getRef().getParent().getKey()</code> I get "chat" back. How do I get back the key for the <code>DataSnapshot</code>? I'm extremely confused right now.</p>