private void btn_save_Click(object sender, EventArgs e) { if (txt_player_Name.Text.Length > 0) { var con = new ConnectionClass(); con.InsertNewPlayer(txt_player_Name.Text, 0); Toast.MakeText(this, "Record Save", ToastLength.Short).Show(); StartActivity(typeof(Play_Game)); } else { Toast.MakeText(this, "Please Fill Name", ToastLength.Short).Show(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.view_score); myConnectionClass = new ConnectionClass(); myList = myConnectionClass.ViewAll(); Button btn_Player = FindViewById <Button> (Resource.Id.btn_Player); btn_Player.Click += btn_Player_Click; // Display the player names and high scores ListView Lv_HighScore = FindViewById <ListView>(Resource.Id.Lv_HighScore); Lv_HighScore.Adapter = new DataAdpter(this, myList); }