本文整理汇总了C#中Android.Content.Intent.AddFlags方法的典型用法代码示例。如果您正苦于以下问题:C# Intent.AddFlags方法的具体用法?C# Intent.AddFlags怎么用?C# Intent.AddFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Content.Intent
的用法示例。
在下文中一共展示了Intent.AddFlags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMessage
protected override void OnMessage (Context context, Intent intent)
{
//Push Notification arrived - print out the keys/values
Intent received = new Intent (context, typeof(RecievedPush));
string pushMessage = intent.GetStringExtra ("message");
received.AddFlags (ActivityFlags.ReorderToFront);
received.AddFlags (ActivityFlags.NewTask);
received.PutExtra ("pushedMessage", pushMessage);
if (intent == null || intent.Extras == null) {
received.PutExtras (intent.Extras);
foreach (var key in intent.Extras.KeySet()) {
Console.WriteLine ("Key: {0}, Value: {1}");
}
}
PendingIntent notificationLaunch = PendingIntent.GetActivity (context, 1000, received, PendingIntentFlags.CancelCurrent );
NotificationManager manager = (NotificationManager)GetSystemService (Context.NotificationService);
NotificationCompat.Builder builder = new NotificationCompat.Builder (context);
builder.SetContentText (pushMessage);
builder.SetContentIntent ( notificationLaunch);
builder.SetContentTitle ("New Message");
builder.SetSmallIcon (Resource.Drawable.ic_action_chat);
builder.SetStyle ( new NotificationCompat.InboxStyle());
builder.SetSound (RingtoneManager.GetDefaultUri (RingtoneType.Notification));
builder.SetVibrate (new long[] { 500, 300, 100, 1000, 300, 300, 300 ,300 });
manager.Notify (1000, builder.Build ());
Buddy.RecordNotificationReceived(intent);
}
示例2: OnCreate
protected override void OnCreate (Bundle bundle)
{
SetTitle(Resource.String.reportcollecting);
var path = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
_filepath = Path.Combine (path, "CallSlips.txt");
base.OnCreate (bundle);
//ShowAlert ();
var prefs = Application.Context.GetSharedPreferences("Violadev", FileCreationMode.Private);
_isLoggedIn = prefs.GetBoolean("Authorized", false);
if (_isLoggedIn)
{
PostReport();
}
else
{
var loginActivity = new Intent(this, typeof(LogIn));
loginActivity.AddFlags(ActivityFlags.ClearTop);
loginActivity.AddFlags(ActivityFlags.NewTask);
loginActivity.AddFlags(ActivityFlags.ClearTask);
StartActivity(loginActivity);
}
// Create your application here
}
示例3: NewDocumentIntent
// Returns a new intent to start NewDocumentActivity as a new document in recents
private Intent NewDocumentIntent()
{
var intent = new Intent (this, Java.Lang.Class.FromType (typeof(NewDocumentActivity)));
intent.AddFlags (ActivityFlags.NewDocument);
intent.AddFlags (ActivityFlags.MultipleTask);
return intent;
}
示例4: OnOptionsItemSelected
public override bool OnOptionsItemSelected (IMenuItem item)
{
Log.Debug (Tag, "Item {0} has been selected.", item.Order);
if (item.ItemId == Android.Resource.Id.Home || item.ItemId == 0) {
return false;
}
var intent = new Intent ();
switch (item.Order) {
case 1:
intent.SetClass (this, typeof(MainActivity));
intent.AddFlags (ActivityFlags.ClearTop); // http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP
StartActivity (intent);
break;
case 2:
intent.SetClass (this, typeof(SpeakersActivity));
intent.AddFlags (ActivityFlags.ClearTop); // http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP
StartActivity (intent);
break;
case 3:
intent.SetClass (this, typeof(SessionsActivity));
intent.AddFlags (ActivityFlags.ClearTop); // http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP
StartActivity (intent);
break;
}
return true;
}
示例5: AddHomeAction
public void AddHomeAction()
{
var homeIntent = new Intent(this, typeof(HomeActivity));
homeIntent.AddFlags(ActivityFlags.ClearTop);
homeIntent.AddFlags(ActivityFlags.NewTask);
ActionBar.SetHomeAction(new MyActionBarAction(this, homeIntent, Resource.Drawable.ic_launcher));
ActionBar.SetDisplayHomeAsUpEnabled(true);
}
示例6: HandleButtonRapporteraCallSlips
public void HandleButtonRapporteraCallSlips(object sender, EventArgs e)
{
var reportFetchActivity = new Intent(this, typeof(ReportFetched));
reportFetchActivity.AddFlags(ActivityFlags.ClearTop);
reportFetchActivity.AddFlags(ActivityFlags.NewTask);
reportFetchActivity.AddFlags(ActivityFlags.ClearTask);
StartActivity(reportFetchActivity);
}
示例7: AddHomeAction
public void AddHomeAction(Type activity, int resId)
{
var homeIntent = new Intent(this, activity);
homeIntent.AddFlags(ActivityFlags.ClearTop);
homeIntent.AddFlags(ActivityFlags.NewTask);
LegacyBar.SetHomeAction(new DefaultLegacyBarAction(this, homeIntent, resId));
LegacyBar.SetDisplayHomeAsUpEnabled(true);
}
示例8: HandleButtonfetchNewCallSlips
//samma som fethCallSlip från menu
//Fetch CallSlips from Viola
public void HandleButtonfetchNewCallSlips(object sender, EventArgs e)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
_filepath = Path.Combine(path, "CallSlips.txt");
File.Delete(_filepath);
var fetchCallSlipsActivity = new Intent(this, typeof(FetchCallSlips));
fetchCallSlipsActivity.AddFlags(ActivityFlags.ClearTop);
fetchCallSlipsActivity.AddFlags(ActivityFlags.NewTask);
fetchCallSlipsActivity.AddFlags(ActivityFlags.ClearTask);
StartActivity(fetchCallSlipsActivity);
}
示例9: OnReceive
public override void OnReceive(Context context, Intent intent)
{
#if TOMIC_ANDROID
if (intent.Action == Intent.ActionBootCompleted)
{
Intent activity = new Intent(context, typeof(SplashActivity));
activity.AddFlags(ActivityFlags.NewTask);
activity.AddFlags(ActivityFlags.SingleTop);
context.StartActivity(activity);
}
#endif
}
示例10: OnCreate
protected override void OnCreate (Android.OS.Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
SetContentView (Resource.Layout.activity_order_complete);
mFullWallet = Intent.GetParcelableExtra (Constants.EXTRA_FULL_WALLET).JavaCast<FullWallet> ();
var continueButton = FindViewById<Button> (Resource.Id.button_continue_shopping);
continueButton.Click += delegate {
var intent = new Intent (this, typeof (ItemListActivity));
intent.AddFlags (ActivityFlags.ClearTask);
intent.AddFlags (ActivityFlags.NewTask);
StartActivity (intent);
};
}
示例11: OnOptionsItemSelected
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item)
{
switch (item.ItemId)
{
case Android.Resource.Id.Home:
// app icon in action bar clicked; go home
var intent = new Intent(this, typeof(DialogActivity));
intent.AddFlags(ActivityFlags.ClearTop);
intent.AddFlags(ActivityFlags.NewTask);
StartActivity(intent);
return true;
default:
return base.OnOptionsItemSelected(item);
}
}
示例12: HandleButtonFetchCallSlipsFromFile
//Fetch CallSlips from CallSlips.txt file
public void HandleButtonFetchCallSlipsFromFile(object sender, EventArgs e)
{
if (System.IO.File.Exists(_filepath) && _filepath != null)
{
var fetchCallSlipsActivity = new Intent(this, typeof(FetchCallSlips));
fetchCallSlipsActivity.AddFlags(ActivityFlags.ClearTop);
fetchCallSlipsActivity.AddFlags(ActivityFlags.NewTask);
fetchCallSlipsActivity.AddFlags(ActivityFlags.ClearTask);
StartActivity(fetchCallSlipsActivity);
}
else
{
Toast.MakeText(this, "Inga icke rapporterad lista", ToastLength.Long).Show();
}
}
示例13: GetView
public override View GetView (Context context, View convertView, ViewGroup parent)
{
View view = base.GetView (context, convertView, parent);
view.Click += delegate {
if (TestCase.RunState != RunState.Runnable)
return;
AndroidRunner runner = AndroidRunner.Runner;
if (!runner.OpenWriter ("Run " + TestCase.FullName, context))
return;
try {
//Test.Run (runner);
runner.Run (TestCase);
} finally {
runner.CloseWriter ();
}
if (Result.ResultState.Status != TestStatus.Passed) {
Intent intent = new Intent (context, typeof(TestResultActivity));
intent.PutExtra ("TestCase", Name);
intent.AddFlags (ActivityFlags.NewTask);
context.StartActivity (intent);
}
};
return view;
}
示例14: OnCreate
/// <summary>
/// Activitie's create event handeler.
/// </summary>
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Create managers and register references
MgrAccessor.RegisterReference<IFileEntryManager>(new FileEntryManager());
MgrAccessor.RegisterReference<ICommonUtils>(new CommonUtils());
MgrAccessor.RegisterReference<IDiskUtils>(new DiskUtils());
#if DEBUG
// Create test data
MgrAccessor.DiskUtils.CreateTestData();
#endif
SetContentView(Resource.Layout.Home);
// Create FileEntryList tab
var intent = new Intent(this, typeof(FileEntryListActivity));
intent.AddFlags(ActivityFlags.NewTask);
var spec = TabHost.NewTabSpec("Explorer");
spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.ic_tab_explorer));
spec.SetContent(intent);
TabHost.AddTab(spec);
// Create About tab
intent = new Intent(this, typeof(AboutActivity));
intent.AddFlags(ActivityFlags.NewTask);
spec = TabHost.NewTabSpec("About");
spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.ic_tab_about));
spec.SetContent(intent);
TabHost.AddTab(spec);
TabHost.CurrentTab = 0;
}
示例15: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Page_Dialog);
var yesNoDialogbutton = FindViewById<Button>(Resource.Id.YesNoDialogButton);
yesNoDialogbutton.Click += delegate
{
var builder = new AlertDialog.Builder(this);
builder.SetMessage(Resource.String.knigts_dialog_title);
builder.SetPositiveButton(Resource.String.yes, (s, e) => { });
builder.SetNegativeButton(Resource.String.no, (s, e) => { }).Create();
builder.Show();
};
var alertDialogButton = FindViewById<Button>(Resource.Id.AlertDialogButton);
alertDialogButton.Click += delegate { ShowDialog(AlertDialog); };
var listDialogButton = FindViewById<Button>(Resource.Id.ListDialogButton);
listDialogButton.Click += delegate { ShowDialog(ListDialog); };
var multiChoiceDialogButton = FindViewById<Button>(Resource.Id.MultiChoiceDialogButton);
multiChoiceDialogButton.Click += delegate { ShowDialog(MultiChoiceDialog); };
var customViewDialogButton = FindViewById<Button>(Resource.Id.CustomViewDialogButton);
customViewDialogButton.Click += delegate { ShowDialog(CustomViewDialog); };
var fragmentDialogsButton = FindViewById<Button>(Resource.Id.FragmentDialogsButton);
fragmentDialogsButton.Click += delegate
{
var intent = new Intent(this, typeof (DialogFragmentActivity));
intent.AddFlags(ActivityFlags.ClearTop);
StartActivity(intent);
};
}