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


C# Intent.RemoveExtra方法代码示例

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


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

示例1: FragmentArgumentsToIntent

        /// <summary>
        /// Fragments the arguments to intent.
        /// </summary>
        /// <returns>The arguments to intent.</returns>
        /// <param name="arguments">Arguments.</param>
        public static Intent FragmentArgumentsToIntent(Bundle arguments)
        {
            Intent intent = new Intent();
            if (arguments == null)
            {
                return intent;
            }

            var data = arguments.GetParcelable("_uri") as Uri;
            if (data != null)
            {
                intent.SetData(data);
            }

            intent.PutExtras(arguments);
            intent.RemoveExtra("_uri");
            return intent;
        }
开发者ID:prashantvc,项目名称:XamarinIO,代码行数:23,代码来源:BaseActivity.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.score);

            score = Intent.GetIntExtra ("SCORE", 0);

            tvScore = FindViewById<TextView> (Resource.Id.scoreTxt);
            tvScore.Text = ScoreText ();
            DisplayHighscores ();

            Button btnAgain = FindViewById<Button> (Resource.Id.btnAgain);
            btnAgain.Click += delegate {
                Intent i = new Intent (this, typeof (QuizActivity));
                i.RemoveExtra ("SCORE");
                StartActivity (i);
                Finish ();
            };

            Button btnQuit = FindViewById<Button> (Resource.Id.btnQuit);
            btnQuit.Click += delegate {
                Finish();
            };
        }
开发者ID:bny-mobile,项目名称:QuizData,代码行数:24,代码来源:EndActivity.cs

示例3: GetIocFromOtpIntent

        private bool GetIocFromOtpIntent(Bundle savedInstanceState, Intent i)
        {
            //create called after detecting an OTP via NFC
            //this means the Activity was not on the back stack before, i.e. no database has been selected

            _ioConnection = null;

            //see if we can get a database from recent:
            if (App.Kp2a.FileDbHelper.HasRecentFiles())
            {
                ICursor filesCursor = App.Kp2a.FileDbHelper.FetchAllFiles();
                StartManagingCursor(filesCursor);
                filesCursor.MoveToFirst();
                IOConnectionInfo ioc = App.Kp2a.FileDbHelper.CursorToIoc(filesCursor);
                if (App.Kp2a.GetFileStorage(ioc).RequiresSetup(ioc) == false)
                {
                    IFileStorage fileStorage = App.Kp2a.GetFileStorage(ioc);

                    if (!fileStorage.RequiresCredentials(ioc))
                    {
                        //ok, we can use this file
                        _ioConnection = ioc;
                    }
                }
            }

            if (_ioConnection == null)
            {
                //We need to go to FileSelectActivity first.
                //For security reasons: discard the OTP (otherwise the user might not select a database now and forget
                //about the OTP, but it would still be stored in the Intents and later be passed to PasswordActivity again.

                Toast.MakeText(this, GetString(Resource.String.otp_discarded_because_no_db), ToastLength.Long).Show();
                GoToFileSelectActivity();
                return false;
            }

            //assume user wants to use OTP (for static password, they need to open KP2A first and select the key provider type, then see OnNewIntent)
            _keyFileOrProvider = KeyProviderIdOtp;

            if (savedInstanceState == null) //only when not re-creating
            {
                //remember the OTP for later use
                _pendingOtps.Add(i.GetStringExtra(Intents.OtpExtraKey));
                i.RemoveExtra(Intents.OtpExtraKey);
            }
            return true;
        }
开发者ID:pythe,项目名称:wristpass,代码行数:48,代码来源:PasswordActivity.cs


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