How to logout from Google+ Account?

别来无恙 提交于 2019-12-10 11:03:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!