I'm having a problem with valueEvenListener on Firebase. Consider the situation:
Firebase ref = new Firebase(Constant.BASEURL).child("myLists");
ref.addValueEventListener(myValueEventListener);
Then I try do update one of the lists value using updateChildren().
HashMap<String, Object> newEditionTimeHM = new HasMap<String, Object>
newEditionTimeHM.put("editionTimeStamp", ServerValue.TIMESTAMP);
ref.child(pushKey).updateChildren(newEditionTimeHM);
It updates but when my listener catches the update, it crashes reporting "failed to bounce to type" error.
On my second try, I create a new shoppinList object with the new values I want and push it using setValue().
newEditionTimeHM.put("editionTimeStamp", ServerValue.TIMESTAMP);
ShoppingList shoppingList = new ShoppingList("Owner unknown", newEditionTimeHM);
ref.child(pushKey).setValue(shoppingList);
When my listeners catches it, no problem is reported.
What is the difference here? Why do I need to create an entirely new object to satisfy the listener? Isn't it more efficient to use updateChildren()? Searched this page for the answer but did not find it.