private void OkButton_Click(object sender, EventArgs e) { var user = SQLiteDb.GetUser(); if (user.Email == "failed") { return; } InputMethodManager imm = (InputMethodManager)GetSystemService(InputMethodService); imm.HideSoftInputFromWindow(nameEditText.WindowToken, 0); ShortAlarm shortAlarm = new ShortAlarm(); Room room = SQLiteDb.FindRoom(choosenRoom); string now = DateTime.Now.ToString("s"); shortAlarm.Archived = false; shortAlarm.RoomId = room.Id; shortAlarm.Name = nameEditText.Text; shortAlarm.UserId = user.Id; shortAlarm.NotifyDate = Convert.ToDateTime(now); WebApiDataController.PostAlarm(this, shortAlarm); Task.Delay(3000); Finish(); }