I have integrated Google authenticate login in my app but after once login if I log out my account still every time app automatically sign in the old user account.
Main
You also need to sign out from GoogleSignInClient
and FirebaseAuth
current user, something like this:
//sign out of the user and start login activity.
public void signOut() {
signOutBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(getContext(), gso);
mGoogleSignInClient.signOut();
FirebaseAuth.getInstance().signOut();
startActivity(new Intent(getContext(), LoginActivity.class));
}
});
}