This is my coding in my java class file where my log out button is located at. How do I log out of my Google Account in Firebase in android studio, such that when I log in again, I am allowed to choose the account I am able to sign in with. Right now, I am always being logged in with the same account.
private GoogleSignInClient mGoogleSignInClient;
Button btnLogout;
FirebaseAuth mAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
btnLogout = findViewById(R.id.btnLogout);
mAuth=FirebaseAuth.getInstance();
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mAuth.signOut();
mGoogleSignInClient.signOut();
Intent intent = new Intent(Profile.this, SplashPage.class);
startActivity(intent);
}
});
}
}