本文整理汇总了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;
}
示例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();
};
}
示例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;
}