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;
		}
        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
0
        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
0
        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);
            };
        }
        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);
            }
        }
		// 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);
			}
		}
        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
0
        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
0
		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);
			};
		}
示例#10
0
 private void StartMainActivity()
 {
     var intent = new Intent();
     intent.SetClass(this, typeof (Main));
     intent.PutExtra("User", JsonConvert.SerializeObject(_user));
     StartActivity(intent);
 }
示例#11
0
        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);
        }
示例#12
0
文件: Viewer.cs 项目: OML/OML_App
 /// <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);
 }
示例#13
0
 void LiveClick(object sender, EventArgs e)
 {
     Intent i = new Intent();
     i.SetClass(this, typeof(Start));
     i.AddFlags(ActivityFlags.NewTask);
     StartActivity(i);
 }
        public override void OnReceive(Context context, Intent intent)
        {
            intent.SetClass(context, typeof (GcmIntentService));

            StartWakefulService(context, intent);
            SetResult(Result.Ok, null, null);
        }
示例#15
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     switch (item.ItemId) {
         case global::Android.Resource.Id.Home:
             new AlertDialog.Builder(this)
                 .SetTitle ("Cancel")
                 .SetMessage ("Are you sure you want to cancel your message?")
                 .SetPositiveButton ("Yes", (o, e) => {
                         var homeIntent = new Intent();
                         homeIntent.PutExtra ("defaultTab", 1);
                         homeIntent.AddFlags (ActivityFlags.ClearTop);
                         homeIntent.SetClass (this, typeof(MainActivity));
                         StartActivity(homeIntent);
                     })
                 .SetNegativeButton ("No", (o, e) => { })
                 .Show ();
             break;
         case Resource.Id.menuCancelMessage:
             new AlertDialog.Builder(this)
                 .SetTitle ("Cancel")
                 .SetMessage ("Are you sure you want to cancel your message?")
                 .SetPositiveButton ("Yes", (o, e) => {
                         var homeIntent = new Intent();
                         homeIntent.PutExtra ("defaultTab", 1);
                         homeIntent.AddFlags (ActivityFlags.ClearTop);
                         homeIntent.SetClass (this, typeof(MainActivity));
                         StartActivity(homeIntent);
                     })
                 .SetNegativeButton ("No", (o, e) => { })
                 .Show ();
             break;
     }
     return true;
 }
示例#16
0
    protected async override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);

      SetContentView(Resource.Layout.Main);
      SetupAzure();

      var podcastsView = FindViewById<ListView>(Resource.Id.podcastsListView);
      podcastAdapter = new PodcastsAdapter(this);
      podcastsView.Adapter = podcastAdapter;

      podcastsView.ItemClick += (sender, e) =>
      {
        
        var intent = new Intent();
        intent.SetClass(this, typeof(PodcastDetailActivity));
        intent.PutExtra("show_number", (int) e.Id);
        StartActivity(intent);
      };

      // Comment this out if you do not want Twitter Authentication
      // You will need to set your Azure permissions to any client with API Key
      await Authenticate();

      AndHUD.Shared.Show(this, Resources.GetString(Resource.String.loading));
      await ViewModel.ExecuteGetPodcastsCommand();
      podcastAdapter.Podcasts = ViewModel.Podcasts;
      podcastAdapter.NotifyDataSetChanged();
      AndHUD.Shared.Dismiss(this);
    }
示例#17
0
        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;
        }
 public void StartIDSelector(View v)
 {
     Intent intent = new Intent();
     intent.SetClass(this, typeof(PanoramaDemoActivityMain));
     intent.PutExtra("pid", DEFAULT_PANORAMA_ID);
     StartActivity(intent);
 }
示例#19
0
        void _tagList_ItemClick(object sender, ItemEventArgs e)
        {
            var intent = new Intent();
            intent.SetClass(this, typeof (SessionsByTagActivity));
            intent.PutExtra("tag", _tags[e.Position]);

            StartActivity(intent);
        }
示例#20
0
        void _speakerList_ItemClick(object sender, ItemEventArgs e)
        {
            var intent = new Intent();
            intent.SetClass(this, typeof (SpeakerActivity));
            intent.PutExtra("email", _speakers[e.Position].Email);

            StartActivity(intent);
        }
示例#21
0
        private void viewRoom(Room room)
        {
            var intent = new Intent();
            intent.SetClass(this, typeof (RoomActivity));
            intent.PutExtra("key", room.Key);

            StartActivity(intent);
        }
示例#22
0
        private void _list_ItemClick(object sender, ItemEventArgs e)
        {
            var speaker = ((SpeakersAdapter)_list.Adapter).GetRow(e.Position);

            var intent = new Intent();
            intent.SetClass(this, typeof(SpeakerActivity));
            intent.PutExtra("Name", speaker.Name);

            StartActivity(intent);
        }
示例#23
0
        private void _list_ItemClick(object sender, ItemEventArgs e)
        {
            var tag = ((TagsAdapter)_list.Adapter).GetRow(e.Position);

            var intent = new Intent();
            intent.SetClass(this, typeof(SessionsActivity));
            intent.PutExtra("Tag", tag.Value);

            StartActivity(intent);
        }
 void ListView_ItemClick(object sender, ItemEventArgs e)
 {
     viewModel.SelectedCageballEvent = viewModel.CageballEvents[e.Position];
     var intent = new Intent();
     intent.SetClass(this, typeof(SignedCageballEventActivity));
     intent.PutExtra("id", viewModel.SelectedCageballEvent.Id);
     intent.PutExtra("signUp", false);
     
     StartActivity(intent);
 }
示例#25
0
        private void _list_ItemClick(object sender, ItemEventArgs e)
        {
            var session = ((SessionsAdapter)_list.Adapter).GetRow(e.Position);

            var intent = new Intent();
            intent.SetClass(this, typeof(SessionActivity));
            intent.PutExtra("Code", session.Code);

            StartActivity(intent);
        }
示例#26
0
        private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var ds3Object = ds3Objects [e.Position];

            var intent = new Intent ();
            intent.SetClass (Activity, typeof(ObjectDetailActivity));
            intent.PutExtra ("selectedDS3ObjectId", ds3Object.Id);

            StartActivityForResult (intent, 100);
        }
示例#27
0
文件: Activity1.cs 项目: OML/OML_App
 /// <summary>
 /// Change to Live activity
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void LiveClick(object sender, EventArgs e)
 {
     //set background to pressed
     live.SetBackgroundResource(Resource.Drawable.livebutton_pressed);
     controller = true;
     Intent i = new Intent();
     i.SetClass(this, typeof(Live));
     i.AddFlags(ActivityFlags.NewTask);
     StartActivity(i);
 }
        void _list_ItemClick(object sender, ItemEventArgs e)
        {
            ICursor item = (ICursor)_list.Adapter.GetItem(e.Position);

            var intent = new Intent();
            intent.SetClass(this, typeof(ViewNoteActivity));
            intent.PutExtra("Title", item.GetString(item.GetColumnIndex(NoteDatabaseConstants.TitleColumn)));
            intent.PutExtra("Content", item.GetString(item.GetColumnIndex(NoteDatabaseConstants.ContentColumn)));

            StartActivity(intent);
        }
        private void _list_ItemClick(object sender, ItemEventArgs e)
        {
            var note = ((NoteListAdapter)_list.Adapter).GetNote(e.Position);

            var intent = new Intent();
            intent.SetClass(this, typeof(ViewNoteActivity));
            intent.PutExtra("Title", note.Title);
            intent.PutExtra("Contents", note.Contents);

            StartActivity(intent);
        }
示例#30
0
        void sponsorList_ItemClick(object sender, ItemEventArgs e)
        {
            var sponsor = _adapter.GetItemAtPosition(e.Position);
            var intent = new Intent();
            intent.SetClass(this, typeof (SponsorActivity));
            intent.PutExtra("name", sponsor.Name);
            intent.PutExtra("description", sponsor.Description);
            intent.PutExtra("website", sponsor.Website);

            StartActivity(intent);
        }
示例#31
0
        void SettingsClicked()
        {
            if (Common.isTabletDevice(this))
            {
                this.FindViewById <FrameLayout>(Resource.Id.details_fragment).Visibility = ViewStates.Gone;
                var ft = SupportFragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.detailInfo_fragment, new SettingsFragment());

                ft.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade);
                ft.Commit();
            }
            else
            {
                var intent = new Android.Content.Intent();
                intent.SetClass(this, typeof(SettingsFragmentActivity));
                StartActivity(intent);
            }
        }