我发现为了登录用户,我必须使用以下代码:
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
退出
new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
disconnect();
}
});
但是当用户重新启动应用程序并且他已经登录(并且之前没有注销)时,是否可以检测到这种“当前登录”状态?
显然,可以在应用程序的设置(共享首选项)中保存“登录”,但是有什么方法可以使用 google api 进行检测?