I have 2 models, the delivery and the vehicle, I need to save the data of the two models in the same%% of the database, I did the following, I used the vehicle. id
but did not save:
private void cadastrarEntregador() {
autenticacao = ConfiguracaoFirebase.getFirebaseAutenticacao();
autenticacao.createUserWithEmailAndPassword(
entregador.getEmail(),
entregador.getSenha()
).addOnCompleteListener(
CadastroEntregadorActivity.this,
new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
snack("Conta criada com sucesso");
entregador.setId(task.getResult().getUser().getUid());
entregador.salvarDados();
veiculo.salvarDados();