问题
After signin up with Google plus on an Android app.
How can I logout, so I can sign in with another account.
Don't know if GoogleAuthUtil.invalidateToken
is the answer or not...
Thanks
回答1:
If you are using Google+ sign in (and you should - the work flow is much better, both for developers and users), then you can sign out the user by following the guide's example:
@Override
public void onClick(View view) {
if (view.getId() == R.id.sign_out_button) {
if (mPlusClient.isConnected()) {
mPlusClient.clearDefaultAccount();
mPlusClient.disconnect();
mPlusClient.connect();
}
}
}
来源:https://stackoverflow.com/questions/16444539/how-to-logout-from-google-account