title: Android Firebase child node listener
body: <p>I would like to know if there is some callback or something that can trigger a method when a child in <code>Firebase database</code> node is change.</p>
  
  <p><a href="https://i.stack.imgur.com/JsW2E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JsW2E.png" alt="enter image description here"></a></p>
  
  <p>For example this "Users" node, each user saved by his own <code>UID</code> and all his data.
  I'm looking for a method that will be trigger when ever the <code>profilePic</code> is changed.</p>
  
  <p>I have tried <code>addChildEventListener</code> and also <code>addValueEventListener</code> but none of them worked.</p>
  
  <p><strong>Here's example</strong></p>
  
  <pre><code>refToUsers.getReference(Params.USERS).child(currentUser.getUid()).child(Params.PROFILEPIC).addChildEventListener(new ChildEventListener() {
      @Override
      public void onChildAdded(DataSnapshot dataSnapshot, String s) {
  
      }
  
      @Override
      public void onChildChanged(DataSnapshot dataSnapshot, String s) {
          Glide.with(getApplication()).load(s).apply(new RequestOptions()
                  .placeholder(R.mipmap.ic_launcher))
                  .into(cvNavUserProfile);
      }
  
      @Override
      public void onChildRemoved(DataSnapshot dataSnapshot) {
  
      }
  
      @Override
      public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
      }
  
      @Override
      public void onCancelled(DatabaseError databaseError) {
  
      }
  });
  </code></pre>
  
  <p><strong>Another method</strong></p>
  
  <pre><code>refToUsers.getReference(Params.USERS).child(currentUser.getUid()).child(Params.PROFILEPIC).addValueEventListener(new ValueEventListener() {
      @Override
      public void onDataChange(DataSnapshot dataSnapshot) {
          Log.d(TAG,"DataSnapshot: " + dataSnapshot.toString());
          String profilePic = null;
  
      }
  
      @Override
      public void onCancelled(DatabaseError databaseError) {
  
      }
  });
  </code></pre>
  
  <p>None of these methods are triggered when <code>profilePic</code> is changed. There is any way to work it out? like callback or listener that will triggered every time the <code>profilePic</code> is <code>update/change</code>?</p>
  
  <p>Also the method can be work only when the user is on a specific Activity? Can it be triggered even when the user is not on the method's activity?</p>