private void itemKlik(object sender, AdapterView.ItemClickEventArgs e) { int pos = e.Position; Intent i = new Intent(this, typeof(Toevoegen)); KleurItem item = kleurAdapter[pos]; i.PutExtra("track3", track); // i.PutExtra("kleur", item.Kleur.ToArgb()); this.StartActivityForResult(i, pos); //utrecht.nepLooppad.Clear(); string [] berichtSplit = track.Split(); int tijd = -1; int datum = -2; int y = -3; int x = -4; for (int a = 0; a < (berichtSplit.Length / 4); a++) { datum = datum + 4; tijd = tijd + 4; y = y + 4; x = x + 4; string datetime = berichtSplit[datum] + berichtSplit[tijd]; DateTime datumtijd = DateTime.Parse(datetime); int rdx = int.Parse(berichtSplit[x]); int rdy = int.Parse(berichtSplit[y]); float rddx = (float)rdx; float rddy = (float)rdy; } utrecht.Invalidate(); }
protected override void OnActivityResult(int pos, Result res, Intent data) { if (res == Result.Ok) { string naam = data.GetStringExtra("naam"); Color kleur = new Color(data.GetIntExtra("kleur", 0)); if (pos == 1000000) { database.Insert(new KleurItem(naam)); } else { KleurItem k = new KleurItem(naam); k.Id = kleuren[pos].Id; database.Update(k); } } else { if (pos < 1000000) { KleurItem k = new KleurItem(); k.Id = kleuren[pos].Id; database.Delete(k); } } this.LeesKleuren(); }