本文整理匯總了Java中com.google.android.gms.games.GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED屬性的典型用法代碼示例。如果您正苦於以下問題:Java GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED屬性的具體用法?Java GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED怎麽用?Java GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.android.gms.games.GamesActivityResultCodes
的用法示例。
在下文中一共展示了GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onActivityResult
@Override
public void onActivityResult(int request, int response, Intent intent) {
super.onActivityResult(request, response, intent);
if (request == SEND_GIFT) {
if (response == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
Toast.makeText(this, "Failed to send gift!", Toast.LENGTH_LONG).show();
}
}
else if (request == SHOW_INBOX) {
if (response == Activity.RESULT_OK && intent != null) {
handleGiftRequest(Games.Requests.getGameRequestsFromInboxResponse(intent));
} else {
Toast.makeText(this, "Error receiving gift!", Toast.LENGTH_LONG).show();
}
}
}
示例2: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case SEND_REQUEST_CODE:
if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
Toast.makeText(this, "FAILED TO SEND REQUEST!",
Toast.LENGTH_LONG).show();
}
break;
case SEND_GIFT_CODE:
if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
Toast.makeText(this, "FAILED TO SEND GIFT!", Toast.LENGTH_LONG)
.show();
}
break;
case SHOW_INBOX:
if (resultCode == Activity.RESULT_OK && data != null) {
handleRequests(Games.Requests
.getGameRequestsFromInboxResponse(data));
} else {
Log.e(TAG, "Failed to process inbox result: resultCode = "
+ resultCode + ", data = "
+ (data == null ? "null" : "valid"));
}
break;
case RC_SIGN_IN:
Log.d(TAG, "onActivityResult with requestCode == RC_SIGN_IN, responseCode="
+ resultCode + ", intent=" + data);
mSignInClicked = false;
mResolvingConnectionFailure = false;
if (resultCode == RESULT_OK) {
mGoogleApiClient.connect();
} else {
BaseGameUtils.showActivityResultError(this, requestCode, resultCode, R.string.signin_other_error);
}
break;
}
super.onActivityResult(requestCode, resultCode, data);
}
示例3: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case SEND_REQUEST_CODE:
if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
Toast.makeText(this, R.string.error_send_request, Toast.LENGTH_LONG).show();
}
break;
case SEND_GIFT_CODE:
if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
Toast.makeText(this, getString(R.string.error_send_gift), Toast.LENGTH_LONG).show();
}
break;
case SHOW_INBOX:
if (resultCode == Activity.RESULT_OK && data != null) {
handleInboxResult(Games.Requests
.getGameRequestsFromInboxResponse(data));
} else {
// handle failure to process inbox result
if(resultCode != Activity.RESULT_CANCELED)
Toast.makeText(this, getString(R.string.error_claim_gift), Toast.LENGTH_LONG).show();
}
break;
case QUEST_CODE:
if (resultCode == Activity.RESULT_OK && data != null) {
Quest quest = data.getParcelableExtra(Quests.EXTRA_QUEST);
if(quest.getState() == Quest.STATE_COMPLETED)
onQuestCompleted(quest);
}
break;
}
super.onActivityResult(requestCode, resultCode, data);
}