private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { Intent intent = new Intent(this, typeof(CreateView)); ListOfWeather = BDD.GetTable(); int pos = e.Position; string weather = JsonConvert.SerializeObject(ListOfWeather[pos]); intent.PutExtra("weather", weather); this.StartActivity(intent); }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); BDD = new Initialisation(); BDD.DBConnection(); base.OnCreate(savedInstanceState); CrossCurrentActivity.Current.Activity = this; BDD.Table[] ListOfWeather = BDD.GetTable(); List<Table> CleanList = new List<Table>(); foreach(Table weather in ListOfWeather) { if (weather != null) { CleanList.Add(weather); } } ListView.Adapter = new DisplayAdapter(this, CleanList); ListView.Clickable = true; ListView.DescendantFocusability = DescendantFocusability.BlockDescendants; ListView.Focusable = false; ListView.ItemClick += View_Click; ListView.ItemSelected += ListView_ItemSelected; ListView.ItemLongClick += ListView_ItemLongClick; }