public void Save(String name, String namePerson, String numberAmount) { DBAdapter db = new DBAdapter(this); db.openDB(); bool saved = db.Add(name, namePerson, numberAmount); //modified Sonething here db.CloseDB(); if (saved) //modified { getHomename.Text = ""; name_Person.Text = ""; number_amount.Text = ""; Toast.MakeText(this, "Details Saved", ToastLength.Short).Show(); } else { Toast.MakeText(this, "Unable to Save, Please Try Again", ToastLength.Short).Show(); } this.GetNameHouse(); }
public void GetSpaceCrafts() { HouseList.Clear(); DBAdapter db = new DBAdapter(this); db.openDB(); ICursor c = db.Retrieve(); //SpaceCraft s = null; if (c != null) { while (c.MoveToNext()) { string phone = c.GetString(c.GetColumnIndex("name")); HouseList.Add(phone); Collections.Sort(HouseList); } } db.CloseDB(); if (HouseList.Size() > 0) { list.Adapter = adapter; } }