2
I have the following knot in firebase:
Inside this node I need to access the user value and change it, to do this I am using this code:
firebaseSenha = ConfiguracaoFirebase.getFirebase().child("usuarios").child(identificadorUsuarioLogado);
firebaseSenha.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Usuario usuarioSenha = dataSnapshot.getValue(Usuario.class);
String senhaRecuperada = senha.getText().toString();
firebaseSenha = ConfiguracaoFirebase.getFirebase();
firebaseSenha = firebaseSenha.child("usuarios").child(identificadorUsuarioLogado);
Usuario usuario = new Usuario();
usuario.setSenha(senhaRecuperada);
firebaseSenha.setValue(usuario);
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
However these code is causing all other fields within the node to be deleted and about only the password value changed, as I do to change only the password value, without deleting the others.
After executing the code it looks like this:
You read in English? Here has an answer to your question.
– Rafael Said
It worked out! Thank you!
– Luis Felipe