private void updateUser() {
mDatabase.child("users").child(userId)
.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Map<String, Object> postValues = new HashMap<String,Object>();
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
postValues.put(snapshot.getKey(),snapshot.getValue());
}
postValues.put("email", email);
postValues.put("firstName", firstName);
postValues.put("lastName", lastName);
mDatabase.child("users").child(userId).updateChildren(postValues);
}
@Override
public void onCancelled(DatabaseError databaseError) {}
}
);
}