Firebase Realtime Database onChildChanged in subelements [duplicate]










0
















This question already has an answer here:



  • How to tell which descendants are changed with on(“child_changed”)

    2 answers



Here is the configuration of my database



enter image description here



I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?



In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.



 @Override
public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
for (DataSnapshot dayRequest: dataSnapshot.getChildren())
// do stuff











share|improve this question















marked as duplicate by Frank van Puffelen android
Users with the  android badge can single-handedly close android questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 13 '18 at 14:43


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















    0
















    This question already has an answer here:



    • How to tell which descendants are changed with on(“child_changed”)

      2 answers



    Here is the configuration of my database



    enter image description here



    I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?



    In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.



     @Override
    public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
    for (DataSnapshot dayRequest: dataSnapshot.getChildren())
    // do stuff











    share|improve this question















    marked as duplicate by Frank van Puffelen android
    Users with the  android badge can single-handedly close android questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Nov 13 '18 at 14:43


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















      0












      0








      0









      This question already has an answer here:



      • How to tell which descendants are changed with on(“child_changed”)

        2 answers



      Here is the configuration of my database



      enter image description here



      I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?



      In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.



       @Override
      public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
      for (DataSnapshot dayRequest: dataSnapshot.getChildren())
      // do stuff











      share|improve this question

















      This question already has an answer here:



      • How to tell which descendants are changed with on(“child_changed”)

        2 answers



      Here is the configuration of my database



      enter image description here



      I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?



      In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.



       @Override
      public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
      for (DataSnapshot dayRequest: dataSnapshot.getChildren())
      // do stuff






      This question already has an answer here:



      • How to tell which descendants are changed with on(“child_changed”)

        2 answers







      android firebase firebase-realtime-database






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 13:59









      KENdi

      5,7992821




      5,7992821










      asked Nov 13 '18 at 11:48









      A. CADERA. CADER

      33




      33




      marked as duplicate by Frank van Puffelen android
      Users with the  android badge can single-handedly close android questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Nov 13 '18 at 14:43


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Frank van Puffelen android
      Users with the  android badge can single-handedly close android questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Nov 13 '18 at 14:43


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Firebase Realtime Database onChild* events work on a list of child nodes.



          If you attach a listener to Requests it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot of a date (the immediate child nodes).



          There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.



          Also see:



          • How to tell which descendants are changed with on("child_changed")

          • What is the correct way to listen to nested changes using Firebase?

          • how to watch for sub-child added event in firebase

          • How can I observe Firebase child value changes in multiple nodes in Swift?





          share|improve this answer





























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Firebase Realtime Database onChild* events work on a list of child nodes.



            If you attach a listener to Requests it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot of a date (the immediate child nodes).



            There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.



            Also see:



            • How to tell which descendants are changed with on("child_changed")

            • What is the correct way to listen to nested changes using Firebase?

            • how to watch for sub-child added event in firebase

            • How can I observe Firebase child value changes in multiple nodes in Swift?





            share|improve this answer



























              0














              Firebase Realtime Database onChild* events work on a list of child nodes.



              If you attach a listener to Requests it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot of a date (the immediate child nodes).



              There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.



              Also see:



              • How to tell which descendants are changed with on("child_changed")

              • What is the correct way to listen to nested changes using Firebase?

              • how to watch for sub-child added event in firebase

              • How can I observe Firebase child value changes in multiple nodes in Swift?





              share|improve this answer

























                0












                0








                0







                Firebase Realtime Database onChild* events work on a list of child nodes.



                If you attach a listener to Requests it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot of a date (the immediate child nodes).



                There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.



                Also see:



                • How to tell which descendants are changed with on("child_changed")

                • What is the correct way to listen to nested changes using Firebase?

                • how to watch for sub-child added event in firebase

                • How can I observe Firebase child value changes in multiple nodes in Swift?





                share|improve this answer













                Firebase Realtime Database onChild* events work on a list of child nodes.



                If you attach a listener to Requests it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot of a date (the immediate child nodes).



                There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.



                Also see:



                • How to tell which descendants are changed with on("child_changed")

                • What is the correct way to listen to nested changes using Firebase?

                • how to watch for sub-child added event in firebase

                • How can I observe Firebase child value changes in multiple nodes in Swift?






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 '18 at 14:41









                Frank van PuffelenFrank van Puffelen

                235k29381407




                235k29381407















                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo