title: How do I check if specific child value exists in FireBase (Android)
body: <p>I have some trouble trying to check if user information is stored already in the FireBase database.
  Basically I'm trying to do something stupid like this:
  "select user_name from user where user_id="+userID+"
  And if the nickname exists it should make the boolean var isFirstTime = false and if it doesn't it should stay true. And after that it should show register box or not.</p>
  
  <p>This is my db:
  <a href="https://i.stack.imgur.com/25tNt.png" rel="nofollow noreferrer">Firebase</a>
  And this is my code in onCreate method:</p>
  
  <pre><code>databaseReference = FirebaseDatabase.getInstance().getReference();
      DatabaseReference dbRefFirstTimeCheck = databaseReference.child("User").child(user.getUid()).child("Nickname");
  
      isFirstTime = true;
      dbRefFirstTimeCheck.addListenerForSingleValueEvent(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              if(dataSnapshot.getValue() != null) {
                  isFirstTime=false;
              }
          }
          @Override
          public void onCancelled(DatabaseError databaseError) {
          }
      });
  
      if(isFirstTime) {
          showNewUserBox();
      }
      else {
  
      }
  </code></pre>
  
  <p>No matter what I do, the methor showNewUserBox() is being called. How do I get the data i need and check if it's there?</p>