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


C# Android.GetIntExtra方法代码示例

本文整理汇总了C#中Android.GetIntExtra方法的典型用法代码示例。如果您正苦于以下问题:C# Android.GetIntExtra方法的具体用法?C# Android.GetIntExtra怎么用?C# Android.GetIntExtra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android的用法示例。


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

示例1: OnActivityResult

 protected override void OnActivityResult (int requestCode, Android.App.Result resultCode, Android.Content.Intent data)
 {
     // retrieve the error code, if available
     int errorCode = -1;
     if (data != null) {
         errorCode = data.GetIntExtra (WalletConstants.ExtraErrorCode, -1);
     }
     switch (requestCode) {
     case REQUEST_CODE_MASKED_WALLET:
         switch (resultCode) {
         case Android.App.Result.Ok:
             var maskedWallet = data.GetParcelableExtra (WalletConstants.ExtraMaskedWallet).JavaCast<MaskedWallet> ();
             launchConfirmationPage(maskedWallet);
             break;
         case Android.App.Result.Canceled:
             break;
         default:
             HandleError (errorCode);
             break;
         }
         break;
     case WalletConstants.ResultError:
         HandleError (errorCode);
         break;
     default:
         base.OnActivityResult (requestCode, resultCode, data);
         break;
     }
 }
开发者ID:apcurium,项目名称:xamarin-bindings,代码行数:29,代码来源:CheckoutActivity.cs

示例2: OnStartCommand

		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);
		}
开发者ID:WalterVale,项目名称:monodroid-samples,代码行数:14,代码来源:NotificationUpdateService.cs

示例3: OnActivityResult

 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 &&
             data.HasExtra (WalletConstants.ExtraMaskedWallet)) {
             mMaskedWallet = data.GetParcelableExtra (WalletConstants.ExtraMaskedWallet).JavaCast<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 WalletConstants.ResultError:
         int errorCode = data.GetIntExtra (WalletConstants.ExtraErrorCode, 0);
         HandleError (errorCode);
         break;
     default:
         base.OnActivityResult (requestCode, resultCode, data);
         break;
     }
 }
开发者ID:apcurium,项目名称:xamarin-bindings,代码行数:22,代码来源:ConfirmationActivity.cs

示例4: OnActivityResult

        public override void OnActivityResult (int requestCode, int resultCode, Android.Content.Intent data)
        {            
            mProgressDialog.Hide ();

            // retrieve the error code, if available
            int errorCode = -1;
            if (data != null)
                errorCode = data.GetIntExtra (WalletConstants.ExtraErrorCode, -1);

            switch (requestCode) {
            case REQUEST_CODE_RESOLVE_ERR:
                if (resultCode == (int)Result.Ok) {
                    mGoogleApiClient.Connect();
                } else {
                    handleUnrecoverableGoogleWalletError(errorCode);
                }
                break;
            case REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET:
                switch (resultCode) {
                case (int)Result.Ok:
                    if (data.HasExtra(WalletConstants.ExtraFullWallet)) {
                        FullWallet fullWallet =
                            data.GetParcelableExtra (WalletConstants.ExtraFullWallet).JavaCast<FullWallet> ();
                        // the full wallet can now be used to process the customer's payment
                        // send the wallet info up to server to process, and to get the result
                        // for sending a transaction status
                        fetchTransactionStatus(fullWallet);
                    } else if (data.HasExtra(WalletConstants.ExtraMaskedWallet)) {
                        // re-launch the activity with new masked wallet information
                        mMaskedWallet = data.GetParcelableExtra (WalletConstants.ExtraMaskedWallet).JavaCast<MaskedWallet> ();
                        mActivityLaunchIntent.PutExtra (Constants.EXTRA_MASKED_WALLET, mMaskedWallet);

                        StartActivity(mActivityLaunchIntent);
                    }
                    break;
                case (int)Result.Canceled:
                    // nothing to do here
                    break;
                default:
                    handleError(errorCode);
                    break;
                }
                break;
            }
        }
开发者ID:apcurium,项目名称:xamarin-bindings,代码行数:45,代码来源:FullWalletConfirmationButtonFragment.cs

示例5: OnNewIntent

    /**
 * If the confirmation page encounters an error it can't handle, it will send the customer back
 * to this page.  The intent should include the error code as an {@code int} in the field
 * {@link WalletConstants#EXTRA_ERROR_CODE}.
 */
    protected override void OnNewIntent (Android.Content.Intent intent)
    {            
        if (intent.HasExtra (WalletConstants.ExtraErrorCode)) {
            int errorCode = intent.GetIntExtra (WalletConstants.ExtraErrorCode, 0);
            HandleError(errorCode);
        }
    }
开发者ID:apcurium,项目名称:xamarin-bindings,代码行数:12,代码来源:CheckoutActivity.cs


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