My problem is that i want to create new user with method firebaseAuth.createUserWithEmailAndPassword(user.getEmail(), password), but after the creation of the new user i don't want to sign in automatically in the new user and just stay in current user.
What am I supposed t do to stay in the same user account?
My code is like this:
public void addUser(User user, String password){
firebaseAuth.createUserWithEmailAndPassword(user.getEmail(), password)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
String userID = task.getResult().getUser().getUid();
FirebaseDatabase .getInstance().getReference(USERS_NODE)
.child(userID)
.setValue(user);
}
}
});
}