title: onDataChange's value returns null
body: <p>I'm trying to get data from my Firebase database
  I have two Fragments, one for signing up and the other for signing in
  I have no problems with inserting data into the Firebase, but somehow i'm unable to return the data from it</p>
  
  <p>These are some codes from my sign in Fragment:</p>
  
  <pre><code>private FirebaseAuth mAuth;
  private FirebaseAuth.AuthStateListener mAuthListener;
  
   @Override
      public void onStart() {
          super.onStart();
          mAuth.addAuthStateListener(mAuthListener);
      }
  
      @Override
      public void onStop() {
          super.onStop();
          if (mAuthListener != null) {
              mAuth.removeAuthStateListener(mAuthListener);
          }
      }
  </code></pre>
  
  <p>I have this code inside <code>onCreate</code> method:</p>
  
  <pre><code> mAuth = FirebaseAuth.getInstance();
          mAuthListener = new FirebaseAuth.AuthStateListener() {
              @Override
              public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
                  user = firebaseAuth.getCurrentUser();
                  if(user != null)
                  {
                      getExistingUserInfo(user.getUid());
              }
          };
  </code></pre>
  
  <p>This is the method where i <code>query</code> the data from my <code>firebase</code></p>
  
  <pre><code> public void getExistingUserInfo(String uid){
  
          final FirebaseDatabase database = FirebaseDatabase.getInstance();
  
          database.getReference("allUsers").child(uid)
                  .orderByChild("emailAddress")
                  .equalTo(mEmailStr)
                  .addValueEventListener(new ValueEventListener() {
                      @Override
                      public void onDataChange(DataSnapshot dataSnapshot) {
                          Log.e("Data Changed YEA!",dataSnapshot.toString());
  
                      }
  
                      @Override
                      public void onCancelled(DatabaseError databaseError) {
                      }
  
                  });
  </code></pre>
  
  <p><strong>The problem is, when i launch the Application and <code>getExistingUserInfo</code> gets called inside <code>onCreate</code>, it returns the data of the last signed in user from my device correctly</strong></p>
  
  <pre><code>&gt; E/Data Changed YEA!: DataSnapshot { key =
  &gt; vWOypZ07sbeQKEtXnAwbEEV7ml43, value = {password=123456789,
  &gt; username=ahmed, sgl=true, emailAddress=ahmeddirect@gmail.com,
  &gt; studyGroupName=Study Group 2} }
  </code></pre>
  
  <p><strong>But when I press sign in, it value returns null</strong></p>
  
  <pre><code>E/Data Changed YEA!: DataSnapshot { key = vWOypZ07sbeQKEtXnAwbEEV7ml43, value = null }
  </code></pre>
  
  <p><strong>So I have to close the application and reopen it in order to get the data correctly!!</strong></p>
  
  <p>The is the code where the user gets signed in, it's inside a <code>clickListener</code> in <code>onCreateView</code> method:</p>
  
  <pre><code>mAuth.signInWithEmailAndPassword(mEmailStr, mPasswordStr).addOnCompleteListener(getActivity(), new OnCompleteListener&lt;AuthResult&gt;() {
                      @Override
                      public void onComplete(Task&lt;AuthResult&gt; task) {
                          if (task.isSuccessful())
  {
  
   Toast.makeText(getContext(),"Succeed!",Toast.LENGTH_LONG).show();
  
                              }
                              else
                              {
                                  Toast.makeText(getContext(),"Failed!",Toast.LENGTH_LONG).show();
                              }
                      }
                  });
  </code></pre>
  
  <p>And this is how my <code>database</code> looks like:</p>
  
  <p><a href="http://i.stack.imgur.com/zQWct.png" rel="nofollow">Click to see the Image</a></p>