本文整理汇总了Java中com.google.android.gms.wallet.WalletConstants.RESULT_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java WalletConstants.RESULT_ERROR属性的具体用法?Java WalletConstants.RESULT_ERROR怎么用?Java WalletConstants.RESULT_ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.gms.wallet.WalletConstants
的用法示例。
在下文中一共展示了WalletConstants.RESULT_ERROR属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_CHANGE_MASKED_WALLET:
if (resultCode == Activity.RESULT_OK &&
data.hasExtra(WalletConstants.EXTRA_MASKED_WALLET)) {
mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
((FullWalletConfirmationFragment) getResultTargetFragment())
.updateMaskedWallet(mMaskedWallet);
}
// you may also want to use the new masked wallet data here, say to recalculate
// shipping or taxes if shipping address changed
break;
case WalletConstants.RESULT_ERROR:
int errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, 0);
handleError(errorCode);
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例2: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_CHANGE_MASKED_WALLET:
if (resultCode == Activity.RESULT_OK &&
data.hasExtra(WalletConstants.EXTRA_MASKED_WALLET)) {
mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
((FullWalletConfirmationButtonFragment) getResultTargetFragment())
.updateMaskedWallet(mMaskedWallet);
displayLoyaltyInformation();
}
// you may also want to use the new masked wallet data here, say to recalculate
// shipping or taxes if shipping address changed
break;
case WalletConstants.RESULT_ERROR:
int errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, 0);
handleError(errorCode);
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例3: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// retrieve the error code, if available
int errorCode = -1;
if (data != null) {
errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1);
}
switch (requestCode) {
case REQUEST_CODE_MASKED_WALLET:
switch (resultCode) {
case Activity.RESULT_OK:
if (data != null) {
mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
confirmPurchase();
}
break;
case Activity.RESULT_CANCELED:
break;
default:
handleError(errorCode);
break;
}
break;
case WalletConstants.RESULT_ERROR:
handleError(errorCode);
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例4: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// retrieve the error code, if available
int errorCode = -1;
if (data != null) {
errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1);
}
switch (requestCode) {
case REQUEST_CODE_MASKED_WALLET:
switch (resultCode) {
case Activity.RESULT_OK:
MaskedWallet maskedWallet =
data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
launchConfirmationPage(maskedWallet);
break;
case Activity.RESULT_CANCELED:
break;
default:
handleError(errorCode);
break;
}
break;
case WalletConstants.RESULT_ERROR:
handleError(errorCode);
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例5: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode,resultCode,data);
switch (requestCode) {
case MASKED_WALLET_REQUEST_CODE:
switch (resultCode) {
case Activity.RESULT_OK:
mMaskedWallet =
data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
break;
case Activity.RESULT_CANCELED:
break;
default:
Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
break;
}
break;
case FULL_WALLET_REQUEST_CODE:
switch (resultCode) {
case Activity.RESULT_OK:
mFullWallet =
data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
Toast.makeText(this, mFullWallet.getProxyCard().getPan().toString(), Toast.LENGTH_LONG).show();
Wallet.Payments.notifyTransactionStatus(mGoogleApiClient,
generateNotifyTransactionStatusRequest(mFullWallet.getGoogleTransactionId(),
NotifyTransactionStatusRequest.Status.SUCCESS));
break;
default:
Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
break;
}
break;
case WalletConstants.RESULT_ERROR:
Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
break;
}
}
示例6: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Log.d(TAG, "Request code: " + requestCode + ", result code: " + resultCode);
switch (requestCode) {
case REQUEST_CODE_MASKED_WALLET:
switch (resultCode) {
case Activity.RESULT_OK:
if (data != null) {
maskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
if (maskedWallet != null) {
googleApiClient.connect();
FullWalletRequest fullWalletRequest
= createFullWalletRequest(maskedWallet.getGoogleTransactionId());
// [START load_full_wallet]
Wallet.Payments.loadFullWallet(googleApiClient, fullWalletRequest,
REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET);
// [END load_full_wallet]
}
}
break;
case Activity.RESULT_CANCELED:
break;
default:
//paymentRequestListener.onPaymentResult(paymentRequest,
// new PaymentResult(new Throwable(errorCode + ": Android Pay error")));
break;
}
break;
case WalletConstants.RESULT_ERROR:
//paymentRequestListener.onPaymentResult(paymentRequest,
// new PaymentResult(new Throwable(errorCode + ": Android Pay error")));
break;
case REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET:
final Intent intent = new Intent("com.adyen.androidpay.ui.AndroidTokenProvided");
switch (resultCode) {
case RESULT_OK:
if (data != null) {
fullWallet = data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
intent.putExtra("androidpay.token", fullWallet.getPaymentMethodToken().getToken());
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
}
break;
case WalletConstants.RESULT_ERROR:
intent.putExtra("androidpay.error", "An error occurred with AndroidPay");
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
break;
default:
intent.putExtra("androidpay.error", "Unknown result code");
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
break;
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}