Get Uid from firebase
<p>I am trying to find the uid from firebase. Let's say I have 3 users in my database, and I want to find the 3rd user uid. </p>

<p><a href="https://i.stack.imgur.com/dWCmi.png" rel="nofollow"><img src="https://i.stack.imgur.com/dWCmi.png" alt="photo of firebase dashbord"></a></p>

<p>Here is json formate witch is just export from firebase:</p>

<pre><code>{
  "-KVKrXu70Ziw0iRw46l5" : {
    "age" : 20,
    "emailId" : "ameerhamza",
    "name" : "hamza"
  },
  "-KVKrkVy5OojpsSUEI24" : {
    "age" : 20,
    "emailId" : "ameerhamza",
    "name" : "hamza"
  },
  "-KVKrkzXy9duyiZq5bM0" : {
    "age" : 21,
    "emailId" : "ameerhamzaaaa",
    "name" : "hamza"
  },
  "-KVKrl5Ax7ptodMYywzg" : {
    "age" : 22,
    "emailId" : "ameerhamza",
    "name" : "hamza"
  },
  "-KVKrr7E6b4-3x6tuwOX" : {
    "age" : 23,
    "emailId" : "ameerhamza",
    "name" : "hamza"
  },
  "-KVKruES01regClm6tWW" : {
    "age" : 24,
    "emailId" : "ameerhamza",
    "name" : "hamza"
  }
}
</code></pre>

<p>Here is code what I done. But it is not working for me.</p>

<pre><code> final FirebaseDatabase database = FirebaseDatabase.getInstance();
        myRef = database.getReference();
       DatabaseReference newRef = myRef.push();
          i++;
                    Student s = new Student("ameerhamza",i,"hamza");
                    newRef.child(newRef.getKey()).setValue(s);
                    final Query queryRef = myRef.orderByChild("emailId").equalTo("ameerhamzaaaa");

                 queryRef.addListenerForSingleValueEvent(new ValueEventListener() {
                     @Override
                     public void onDataChange(DataSnapshot dataSnapshot) {
                         Log.d("Firebase UID ",dataSnapshot.getKey());//it always null 
                         Student s = dataSnapshot.getValue(Student.class);



                     }

                     @Override
                     public void onCancelled(DatabaseError databaseError) {

                     }
                 });
</code></pre>