public override void OnBackPressed() { TreePagerAdapter.bmp = null; ListItems.Syokika(); Console.WriteLine("ああああああああああああああああああああああああああああああ"); Finish(); }
protected void Getfromdb() { string dbPath = System.IO.Path.Combine( Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).ToString(), "App4no.db"); SQLiteConnection db = new SQLiteConnection(dbPath); var table_sorted = plan_main.SortCard(db); ListItems.Syokika(); foreach (var a in table_sorted) { ListItems.IdList.Add(a.Id); ListItems.DateList.Add(a.dateTime.Year + "/" + a.dateTime.Month + "/" + a.dateTime.Day); ListItems.TimeList.Add(a.dateTime.Hour.ToString() + ":" + a.dateTime.Minute.ToString()); ListItems.CommentList.Add(a.Comment); ListItems.PlanList.Add(a.Plan); } }
public override void OnSwiped(ViewHolder viewHolder, int direction) { int position = viewHolder.AdapterPosition; ListItems.DateList.RemoveAt(position); ListItems.TimeList.RemoveAt(position); ListItems.CommentList.RemoveAt(position); ListItems.PlanList.RemoveAt(position); string dbPath = Path.Combine(Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).ToString(), "App4no.db"); SQLiteConnection db = new SQLiteConnection(dbPath); mAdapter.NotifyItemRemoved(position); int SwipedId = ListItems.IdList[position]; db.Query <Stock>("DELETE FROM Items WHERE _id=?", SwipedId); ListItems.Syokika(); Getfromdb(); }