Exemplo n.º 1
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var selected = (ProjectModel)ListAdapter.GetItem(position);

            // Launch activity to view/edit the currently selected item
            StartAddProject(selected.Id, typeof(BugListActivity));
        }
Exemplo n.º 2
0
        public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo)
        {
            var info = (AdapterView.AdapterContextMenuInfo)menuInfo;
            var note = (Note)ListAdapter.GetItem(info.Position);

            // Add a menu item to delete the note
            menu.Add(0, MENU_ITEM_DELETE, 0, Resource.String.menu_delete);
        }
Exemplo n.º 3
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var selected = (Note)ListAdapter.GetItem(position);

            // Launch activity to view/edit the currently selected item
            var intent = new Intent(this, typeof(NoteEditorActivity));

            intent.PutExtra("note_id", selected.Id);

            StartActivityForResult(intent, 0);
        }
Exemplo n.º 4
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var selected = (BugModel)ListAdapter.GetItem(position);

            // Launch activity to view/edit the currently selected item
            var intent = new Intent(this, typeof(BugDetails));

            intent.PutExtra("bug_id", selected.Id);

            StartActivity(intent);
        }
        private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            string item = ListAdapter.GetItem(e.Position).ToString();

            if (item.StartsWith("https://") || item.StartsWith("http://"))
            {
                Android.Net.Uri uri     = Android.Net.Uri.Parse(item);
                var             Browser = new Intent(Intent.ActionView, uri);
                Browser.AddFlags(ActivityFlags.ExcludeFromRecents);
                Browser.SetFlags(ActivityFlags.NoHistory);
                StartActivity(Browser);
            }
        }
Exemplo n.º 6
0
        public override void OnSaveInstanceState(Bundle outState)
        {
            base.OnSaveInstanceState(outState);
            string ciudad = "";

            if (ListAdapter != null)
            {
                for (int ind = 0; ind < ListAdapter.Count; ind++)
                {
                    var obj = ListAdapter.GetItem(ind);
                    ciudad += "" + (ciudad.Length > 0 ? "|" : "") + obj.ToString();
                }
                outState.PutString("LLAVE_GUARDADA", ciudad);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// This method will be called when an item in the list is selected.
 /// </summary>
 /// <param name="l">The ListView where the click happened.</param>
 /// <param name="v">The view that was clicked within the ListView.</param>
 /// <param name="position">The position of the view in the list.</param>
 /// <param name="id">The row id of the item that was clicked.</param>
 public override void OnListItemClick(ListView l, View v, int position, long id)
 {
     base.OnListItemClick(l, v, position, id);
     // if parent is not fragment
     if (!_isParentFragment)
     {
         // switch to the next list
         SwitchToNextList(position);
     }
     else
     {
         // switch to the barcode editor
         SwitchToBarcodeEditorFragment((string)ListAdapter.GetItem(position));
     }
 }
Exemplo n.º 8
0
        public override bool OnContextItemSelected(IMenuItem item)
        {
            var info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo;
            var note = (Note)ListAdapter.GetItem(info.Position);

            switch (item.ItemId)
            {
            case MENU_ITEM_DELETE: {
                // Delete the note that the context menu is for
                NoteRepository.DeleteNote(note);
                PopulateList();
                return(true);
            }
            }

            return(false);
        }
Exemplo n.º 9
0
        public override bool OnContextItemSelected(IMenuItem item)
        {
            var info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo;
            var bug  = (BugModel)ListAdapter.GetItem(info.Position);

            switch (item.ItemId)
            {
            case Resource.Id.markFixedBug:
                BugRepository.MarkAsFixed(bug.Id);

                Toast.MakeText(this, Resource.String.bugSaved, ToastLength.Short).Show();

                PopulateList();
                break;
            }

            return(base.OnContextItemSelected(item));
        }
Exemplo n.º 10
0
        public override void OnBackPressed()
        {
            base.OnBackPressed();

            //更新绑定用户
            var array = ListView.CheckedItemPositions;

            Storage.BindUsers.Clear();
            for (int i = 0; i < array.Size(); i++)
            {
                if (!array.ValueAt(i))
                {
                    continue;
                }
                int index = array.KeyAt(i);
                Storage.BindUsers.Add(ListAdapter.GetItem(index).ToString());
            }
            Storage.IsAssigned = true;
        }
Exemplo n.º 11
0
        public override bool OnContextItemSelected(IMenuItem item)
        {
            var info    = (AdapterView.AdapterContextMenuInfo)item.MenuInfo;
            var project = (ProjectModel)ListAdapter.GetItem(info.Position);

            switch (item.ItemId)
            {
            case Resource.Id.editProject:
                StartAddProject(project.Id, typeof(AddProjectActivity));
                break;

            case Resource.Id.deleteProject:
                _selectedProject = project.Id;
                ShowDialog(ALERT_DELETE_DIALOG);
                break;
            }

            return(base.OnContextItemSelected(item));
        }
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            DemoDetails demo = (DemoDetails)ListAdapter.GetItem(position);

            StartActivity(new Intent(this, demo.activityClass));
        }
Exemplo n.º 13
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var demo = (DemoDetails)ListAdapter.GetItem(position);

            StartActivity(demo.ActivityType);
        }
Exemplo n.º 14
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            Intent startActivity = (Intent)ListAdapter.GetItem(position);

            StartActivity(startActivity);
        }
Exemplo n.º 15
0
        public override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var device = (WifiP2pDevice)ListAdapter.GetItem(position);

            ((IDeviceActionListener)Activity).ShowDetails(device);
        }