protected override void OnActivityResult(int requestCode, Android.App.Result resultCode, Android.Content.Intent data)
        {
            switch (requestCode)
            {
            case REQUEST_CODE_CHANGE_MASKED_WALLET:
                if (resultCode == Android.App.Result.Ok &&
                    // removed https://developers.google.com/android/guides/releases#august_27_2019
                    data.HasExtra(Android.Gms.Wallet.WalletConstants.ExtraMaskedWallet))
                {
                    // removed https://developers.google.com/android/guides/releases#august_27_2019
                    mMaskedWallet = data.GetParcelableExtra(Android.Gms.Wallet.WalletConstants.ExtraMaskedWallet).JavaCast <Android.Gms.Wallet.MaskedWallet> ();
                    ((FullWalletConfirmationButtonFragment)ResultTargetFragment)
                    .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 Android.Gms.Wallet.WalletConstants.ResultError:
                int errorCode = data.GetIntExtra(Android.Gms.Wallet.WalletConstants.ExtraErrorCode, 0);
                HandleError(errorCode);
                break;

            default:
                base.OnActivityResult(requestCode, resultCode, data);
                break;
            }
        }
Пример #2
0
 public override Android.App.StartCommandResult OnStartCommand(Android.Content.Intent intent, Android.App.StartCommandFlags flags, int startId)
 {
     if (intent != null)
     {
         string action = intent.Action;
         if (Constants.ActionDismiss.Equals(action))
         {
             // We need to dismiss the wearable notification. We delete the DataItem that created the notification to inform the wearable.
             int notificationId = intent.GetIntExtra(Constants.KeyNotificationId, -1);
             if (notificationId == Constants.BothId)
             {
                 DismissWearableNotification(notificationId);
             }
         }
     }
     return(base.OnStartCommand(intent, flags, startId));
 }