当前位置: 首页>>代码示例>>Java>>正文


Java CommonStatusCodes.SIGN_IN_REQUIRED属性代码示例

本文整理汇总了Java中com.google.android.gms.common.api.CommonStatusCodes.SIGN_IN_REQUIRED属性的典型用法代码示例。如果您正苦于以下问题:Java CommonStatusCodes.SIGN_IN_REQUIRED属性的具体用法?Java CommonStatusCodes.SIGN_IN_REQUIRED怎么用?Java CommonStatusCodes.SIGN_IN_REQUIRED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.gms.common.api.CommonStatusCodes的用法示例。


在下文中一共展示了CommonStatusCodes.SIGN_IN_REQUIRED属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResult

@Override
public void onResult(@NonNull Status status) {
    if (status.isSuccess()) {
        login();
    } else if (status.hasResolution() && status.getStatusCode() != CommonStatusCodes.SIGN_IN_REQUIRED) {
        try {
            status.startResolutionForResult(LoginActivity.this, GoogleApiAdapter.REGISTER_CREDENTIAL);
        } catch (IntentSender.SendIntentException e) {
            // We couldn't register, but we have to keep on
            login();
        }
    }
}
 
开发者ID:Sefford,项目名称:BeAuthentic,代码行数:13,代码来源:LoginActivity.java

示例2: onCredentialRetrievalError

void onCredentialRetrievalError(Activity activity, Status status, int requestCode) {
    if (status.hasResolution() && status.getStatusCode() != CommonStatusCodes.SIGN_IN_REQUIRED) {
        try {
            status.startResolutionForResult(activity, requestCode);
        } catch (IntentSender.SendIntentException e) {
            Log.e(TAG, "Failed to send intent for Smart Lock resolution", e);
            startLockFromActivity(activity);
        }
    } else {
        Log.e(TAG, "Couldn't read the credentials using Smart Lock. Showing Lock...");
        startLockFromActivity(activity);
    }
}
 
开发者ID:auth0,项目名称:Lock-SmartLock,代码行数:13,代码来源:SmartLock.java

示例3: onResult

@Override
public void onResult(LoadPeopleResult peopleData) {
    switch (peopleData.getStatus().getStatusCode()) {
        case CommonStatusCodes.SUCCESS:
            mListItems.clear();
            PersonBuffer personBuffer = peopleData.getPersonBuffer();
            try {
                int count = personBuffer.getCount();
                for (int i = 0; i < count; i++) {
                    mListItems.add(personBuffer.get(i).getDisplayName());
                }
            } finally {
                personBuffer.close();
            }

            mListAdapter.notifyDataSetChanged();
            break;

        case CommonStatusCodes.SIGN_IN_REQUIRED:
            mGoogleApiClient.disconnect();
            mGoogleApiClient.connect();
            break;

        default:
            Log.e(TAG, "Error when listing people: " + peopleData.getStatus());
            break;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:28,代码来源:ListVisiblePeopleActivity.java

示例4: onResult

@Override
public void onResult(LoadMomentsResult momentData) {
    switch (momentData.getStatus().getStatusCode()) {
        case CommonStatusCodes.SUCCESS:
            MomentBuffer momentBuffer = momentData.getMomentBuffer();
            mListItems.clear();
            try {
                int count = momentBuffer.getCount();
                for (int i = 0; i < count; i++) {
                    mListItems.add(momentBuffer.get(i).freeze());
                }
            } finally {
                momentBuffer.close();
            }

            mMomentListAdapter.notifyDataSetChanged();
            break;

        case CommonStatusCodes.SIGN_IN_REQUIRED:
            mGoogleApiClient.disconnect();
            mGoogleApiClient.connect();
            break;

        default:
            Log.e(TAG, "Error when listing moments: " + momentData.getStatus());
            break;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:28,代码来源:ListMomentsActivity.java

示例5: onResult

@Override
public void onResult(Status status) {
    switch (status.getStatusCode()) {
        case CommonStatusCodes.SUCCESS:
            Toast.makeText(this, getString(R.string.plus_write_moment_status_success),
                    Toast.LENGTH_SHORT).show();
            break;

        case CommonStatusCodes.SUCCESS_CACHE:
            Toast.makeText(this, getString(R.string.plus_write_moment_status_cached),
                    Toast.LENGTH_SHORT).show();
            break;

        case CommonStatusCodes.SIGN_IN_REQUIRED:
            Toast.makeText(this, getString(R.string.plus_write_moment_status_auth_error),
                    Toast.LENGTH_SHORT).show();
            mGoogleApiClient.disconnect();
            mGoogleApiClient.connect();
            break;

        default:
            Toast.makeText(this, getString(R.string.plus_write_moment_status_error),
                    Toast.LENGTH_SHORT).show();
            Log.e(TAG, "Error when writing moments: " + status);
            break;
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:27,代码来源:MomentActivity.java


注:本文中的com.google.android.gms.common.api.CommonStatusCodes.SIGN_IN_REQUIRED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。