Esempio n. 1
0
        protected void OnListItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var listView = sender as ListView;
            var t        = TableItem.GetItems()[e.Position];

            Android.Widget.Toast.MakeText(this, t.Name, Android.Widget.ToastLength.Short).Show();
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.OneView);

            _listView = FindViewById <ListView>(Resource.Id.ListViewRoot); // get reference to the ListView in the layout

            // NOTE: Must be set to ensure that selected row backcolor works.
            _listView.ChoiceMode = ChoiceMode.Multiple;

            // populate the listview with data
            _listView.Adapter    = new HomeScreenAdapter(this, TableItem.GetItems().ToList());
            _listView.ItemClick += OnListItemClick;  // to be defined
        }