title: Firebase Android addListenerForSingleValueEvent sometimes not returning data
body: <p>When my application starts, I check the current user's details in my Firebase database (I'm storing it's uid for that).</p>
  
  <p>I'm attaching addListenerForSingleValueEvent to user's ref to read it's data.</p>
  
  <p>My problem is that sometimes, it doesn't return any value, neither success nor failure.</p>
  
  <p>Only clearing application's data solves it, but of course forces the user to login again.</p>
  
  <p>I've read some posts at SO, but didn't find any solution.</p>
  
  <p>Here's my piece of code:</p>
  
  <pre><code>DatabaseReference newUser =    
  FirebaseDatabase.getInstance().getReference("users/"+uid);
  newUser.addListenerForSingleValueEvent(new ValueEventListener()     
      @Override
      public void onDataChange(DataSnapshot snapshot) {}
  
      @Override
      public void onCancelled(DatabaseError databaseError) {}
  });
  </code></pre>