RC_SIGN_IN在googleplus登录中的含义是什么

问题描述 投票:23回答:1

我需要使用google plus按钮添加登录到我的应用程序。我在这个Link上关注了google的文档。但是在signin方法中有一个名为RC_SIGN_IN的值。我不知道我应该分配给RC_SIGN_IN的值是什么。

android google-plus google-play-services google-login
1个回答
37
投票

RC_SIGN in是您为启动新活动而分配的请求代码。这可以是任何数字。当用户完成后续活动并返回时,系统会调用您的活动的onActivityResult()方法。那个方法就像:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Check which request we're responding to
    if (requestCode == RC_SIGN) {

    }
}

有关详细信息,请参阅here

根据您的要求,只需为RC_SIGN分配任何数字。

© www.soinside.com 2019 - 2024. All rights reserved.