本文整理汇总了C#中Android.Content.Intent.SetClass方法的典型用法代码示例。如果您正苦于以下问题:C# Intent.SetClass方法的具体用法?C# Intent.SetClass怎么用?C# Intent.SetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Content.Intent
的用法示例。
在下文中一共展示了Intent.SetClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: _list_ItemClick
private void _list_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
var bm = ((HomeAdapter)_list.Adapter).GetRow(e.Position);
var intent = new Intent();
switch (bm.SortOrder)
{
case 0:
if (!String.IsNullOrEmpty(bm.Day))
{ // use date
intent.SetClass(this, typeof(SessionsActivity));
intent.PutExtra("SelectedDateTime", bm.Day);
}
else
{ // use session
intent.SetClass(this, typeof(SessionActivity));
intent.PutExtra("Code", bm.SessCode);
}
StartActivity(intent);
break;
case 1:
intent.SetClass(this, typeof(SessionsActivity));
intent.PutExtra("SelectedDate", bm.Day);
StartActivity(intent);
break;
case 2:
// for future use
break;
}
}
示例3: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Replenishment);
OnBind(1, as_where);
TextView title = FindViewById<TextView>(Resource.Id.Replenishment_title);
title.Text = SysVisitor.cus_name;
Button btn_left = FindViewById<Button>(Resource.Id.Replenishment_btnPageLeft);
Button btn_right = FindViewById<Button>(Resource.Id.Replenishment_btnPageRight);
Button next = FindViewById<Button>(Resource.Id.Replenishment_next);
Button back = FindViewById<Button>(Resource.Id.Replenishment_cancel);
EditText search = FindViewById<EditText>(Resource.Id.Replenishment_etSearch);
ImageView ivDeleteText = FindViewById<ImageView>(Resource.Id.Replenishment_ivDeleteText);
ivDeleteText.Click += delegate { search.Text = ""; ivDeleteText.Visibility = ViewStates.Gone; };
search.TextChanged += delegate { pageIndex = 1; ivDeleteText.Visibility = ViewStates.Visible; OnBind(pageIndex, search.Text); };
//search.Click += delegate { OnBind(pageIndex, search.Text); };
btn_left.Click += delegate
{
if (pageIndex == 1)
return;
if (pageCount == 1)
return;
else
{
pageIndex = pageIndex - 1;
OnBind(pageIndex, search.Text);
}
};
btn_right.Click += delegate
{
if (pageCount == 1 || pageCount == 0)
return;
if (pageIndex == 1)
OnBind(pageIndex + 1, as_where);
if (pageIndex == pageCount)
return;
else
{
pageIndex = pageIndex + 1;
OnBind(pageIndex, search.Text);
}
};
next.Click += delegate
{
Intent it = new Intent();
it.SetClass(this.ApplicationContext, typeof(OrderSave));
StartActivity(it);
};
back.Click += delegate
{
Intent intent = new Intent();
intent.SetClass(this, typeof(Customer));
StartActivity(intent);
Finish();
};
new Core.Menu(this);
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Department);
var listView = FindViewById<ListView>(Resource.Id.listViewDepartment);
var personList = SQLiteHelper.GetPersonData();
listView.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1,
personList.GroupBy(p => p.DEPARTMENT).Select(p => p.Key).ToArray());
listView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
{
Activity act = this as Activity;
Intent intent = new Intent();
intent.SetClass(act, typeof(ContactList));
Bundle b = new Bundle();
b.PutString("department", (e.View as TextView).Text);
intent.PutExtras(b);
act.StartActivity(intent);
};
}
示例5: ShowDetails
private void ShowDetails(int playId)
{
_currentPlayId = playId;
if (_isDualPane)
{
// We can display everything in-place with fragments.
// Have the list highlight this item and show the data.
ListView.SetItemChecked(playId, true);
// Check what fragment is shown, replace if needed.
var details = FragmentManager.FindFragmentById(Resource.Id.details) as DetailsFragment;
if (details == null || details.ShownPlayId != playId)
{
// Make new fragment to show this selection.
details = DetailsFragment.NewInstance(playId);
// Execute a transaction, replacing any existing
// fragment with this one inside the frame.
var ft = FragmentManager.BeginTransaction();
ft.Replace(Resource.Id.details, details);
ft.SetTransition(FragmentTransit.FragmentFade);
ft.Commit();
}
}
else
{
// Otherwise we need to launch a new activity to display
// the dialog fragment with selected text.
var intent = new Intent();
intent.SetClass(Activity, typeof(DetailsActivity));
intent.PutExtra("current_play_id", playId);
StartActivity(intent);
}
}
示例6: ShowTweet
// Private Methods
private void ShowTweet(int inPosition)
{
// var detailsFrame = Activity.FindViewById<View>(Resource.Id.tweet_details);
if (fIsDualPane)
{
// We can display everything in place with fragments.
// Have the list highlight this item and show the data.
ListView.SetItemChecked(inPosition, true);
// Check what fragment is shown, replace if needed.
var details = FragmentManager.FindFragmentById(Resource.Id.frame_details) as TweetDetailsFragment;
if (details == null || details.TweetPosition != inPosition)
{
// Make new fragment to show this selection.
details = TweetDetailsFragment.NewInstance(inPosition);
// Execute a transaction, replacing any existing
// fragment with this one inside the frame.
var ft = FragmentManager.BeginTransaction();
ft.Replace(Resource.Id.frame_details, details);
// ft.SetTransition(FragmentTransaction.TransitFragmentFade);
ft.Commit();
}
}
else
{
// Otherwise we need to launch a new Activity to display
// the dialog fragment with selected text.
var intent = new Intent();
intent.SetClass(Activity, typeof(TweetDitailsActivity));
intent.PutExtra("tweet", inPosition);
StartActivity(intent);
}
}
示例7: OnHandleIntent
protected override void OnHandleIntent(Intent intent)
{
if (LocationClient.HasError(intent))
{
Log.Debug(TAG, "Location Services error");
StartActivity(new Intent(this, typeof (AlarmErrorScreen)).AddFlags(ActivityFlags.NewTask));
}
else
{
Log.Debug(TAG, "Location Services success");
var geofences = LocationClient.GetTriggeringGeofences(intent);
if (geofences == null || geofences.Count <= 0) return;
var requestId = geofences[0].RequestId;
var dbManager = new DBManager();
var alarm = dbManager.GetAlarmByGeofenceRequestId(requestId);
if (alarm == null) return;
StartActivity(intent.SetClass(this, typeof (AlarmScreen))
.AddFlags(ActivityFlags.NewTask)
.PutExtra(Constants.AlarmsData_Extra, JsonConvert.SerializeObject(alarm)));
StartService(new Intent(this, typeof (UIWhileRingingIntentService))
.SetAction(UIWhileRingingIntentService.StartAlarmAction)
.PutExtra(Constants.AlarmsData_Extra, JsonConvert.SerializeObject(alarm)));
}
}
示例8: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.GetMain);
Button back = FindViewById<Button>(Resource.Id.GetMian_cancel);
ListView list = FindViewById<ListView>(Resource.Id.GetMian_items);
Button save = FindViewById<Button>(Resource.Id.GetMian_save);
OnBind();
save.Click += delegate
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.SetTitle("提示:");
builder.SetMessage("确认同步订单吗?");
builder.SetNegativeButton("确定", delegate
{
string msg = Sync.syncOrder();
AlertDialog.Builder bd = new AlertDialog.Builder(this);
bd.SetTitle("提示:");
bd.SetMessage(msg);
bd.SetNegativeButton("确定", delegate { });
bd.Show();
});
builder.Show();
};
back.Click += delegate
{
Intent intent = new Intent();
intent.SetClass(this, typeof(Index));
StartActivity(intent);
Finish();
};
new Core.Menu(this);
}
示例9: OnOptionsItemSelected
public override bool OnOptionsItemSelected(IMenuItem item)
{
switch (item.ItemId) {
case Resource.Id.sendSMS:
break;
case Resource.Id.menuCreateGroup:
var groupName = new EditText(this);
new AlertDialog.Builder(this)
.SetTitle ("New SMS Group")
.SetMessage ("Please enter a name for the SMS group:")
.SetView (groupName)
.SetPositiveButton ("Ok", (o, e) => {
var imm = (InputMethodManager)GetSystemService(InputMethodService);
imm.HideSoftInputFromWindow (groupName.WindowToken, HideSoftInputFlags.None);
var intent = new Intent();
intent.SetClass(this, typeof(NewSmsGroupActivity));
intent.PutExtra("name", groupName.Text);
StartActivity(intent);
})
.SetNegativeButton ("Cancel", (o, e) => { })
.Show ();
break;
}
return true;
}
示例10: Uri
readonly Uri redirectUrl = new Uri ("com.sample.salesforce:/oauth2Callback"); // Replace with your custom callback.
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
Client = new SalesforceClient (Key, Secret, redirectUrl);
Client.AuthenticationComplete += (sender, e) => OnAuthenticationCompleted (e);
var users = Client.LoadUsers ();
if (!users.Any()) {
var intent = Client.GetLoginInterface () as Intent;
StartActivityForResult (intent, 42);
} else {
LoadAccounts ();
}
ListView.ItemClick += (sender,e) => {
var t = ((DataAdapter)ListAdapter)[e.Position];
System.Diagnostics.Debug.WriteLine("Clicked on " + t.ToString());
var intent = new Intent();
intent.SetClass(this, typeof(DetailActivity));
intent.PutExtra("JsonItem", "{\"attributes\": {\"type\": \"Account\", \"url\": \"/services/data/v28.0/sobjects/Account/\"}, " +
string.Format ("\"Id\": \"{0}\", \"Name\": \"{1}\", \"AccountNumber\": \"{2}\", \"Phone\": \"{3}\", \"Website\": \"{4}\", \"Industry\": \"{5}\"", t.Id, t.Name, t.AccountNumber, t.Phone, t.Website, t.Industry) + "}");
StartActivity(intent);
};
}
示例11: StartMainActivity
private void StartMainActivity()
{
var intent = new Intent();
intent.SetClass(this, typeof (Main));
intent.PutExtra("User", JsonConvert.SerializeObject(_user));
StartActivity(intent);
}
示例12: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.OrderSave);
Button back = FindViewById<Button>(Resource.Id.OrderSave_cancel);
ListView list = FindViewById<ListView>(Resource.Id.OrderSave_items);
Button save = FindViewById<Button>(Resource.Id.OrderSave_save);
OnBind();
back.Click += delegate
{
Intent intent = new Intent();
intent.SetClass(this, typeof(Index));
StartActivity(intent);
Finish();
};
save.Click += delegate
{
if (Shopping.GetShoppingToStr() == "")
{
Toast.MakeText(this, "购物车为空,请先添加商品", ToastLength.Short).Show();
return;
}
of_Save();
Intent it = new Intent();
it.SetClass(this, typeof(GetMian));
StartActivity(it);
};
new Core.Menu(this);
}
示例13: loadSpectate
/// <summary>
/// method to load the viewer's view
/// </summary>
private void loadSpectate()
{
Intent i = new Intent();
i.SetClass(this, typeof(Spectate));
i.AddFlags(ActivityFlags.NewTask);
StartActivity(i);
}
示例14: LiveClick
void LiveClick(object sender, EventArgs e)
{
Intent i = new Intent();
i.SetClass(this, typeof(Start));
i.AddFlags(ActivityFlags.NewTask);
StartActivity(i);
}
示例15: OnReceive
public override void OnReceive(Context context, Intent intent)
{
intent.SetClass(context, typeof (GcmIntentService));
StartWakefulService(context, intent);
SetResult(Result.Ok, null, null);
}