title: firebase on Data Change is called multiple times in add value event listener
body: <p>I have set two listeners </p>
  
  <ol>
  <li>Query to get the last message</li>
  <li>If the last message is group type I'm getting group info using group Listener</li>
  </ol>
  
  <p>However, when I get the type from the message using messageListener and set groupListener it returns multiple onDataChange 
  <code>Debug.e("parentsnap",dataSnapshot.getValue().toString());</code> gets called more than one times
  How should I do it, please guide</p>
  
  <pre><code>    groupListener = new ValueEventListener() {
          @SuppressWarnings("unchecked")
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              Debug.e("parent snap", dataSnapshot.getValue().toString());
              for (DataSnapshot d :
                      dataSnapshot.getChildren()) {
             //my code
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      };
      groups.child(chatId).addValueEventListener(groupListener);
  </code></pre>