當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。