public void clickSavePersonal(View view) { // Get Value From Edittext nameUserString = nameUserEditText.getText().toString().trim(); historyString = historyEditText.getText().toString().trim(); usedString = usedEditText.getText().toString().trim(); allergiesString = allergiesEditText.getText().toString().trim(); resistanceString = resistanceEditText.getText().toString().trim(); myDrugString = myDrugEditText.getText().toString().trim(); // Check Space if ((nameUserString.equals("") || historyString.equals("") || usedString.equals("") || allergiesString.equals("") || resistanceString.equals("") || myDrugString.equals(""))) { // ไม่ยอมให้ผ่าน MyAlertDialog objMyAlertDialog = new MyAlertDialog(); objMyAlertDialog.myDialog(PersonalActivity.this, "มีช่องว่าง", "กรอกให้ครบทุกช่อง"); } else { // ผ่านได้ Calendar objCalendar = Calendar.getInstance(); int intHr = objCalendar.get(Calendar.HOUR_OF_DAY); int intMinus = objCalendar.get(Calendar.MINUTE); timeAlertAnInt = intHr + alertAnInt; Log.d("drug", "alertHr ==> " + Integer.toString(timeAlertAnInt)); ManageTABLE objManageTABLE = new ManageTABLE(this); objManageTABLE.addNewValue( nameUserString, historyString, usedString, allergiesString, resistanceString, myDrugString, Integer.toString(timeAlertAnInt)); testAlarm(minAlarmAnInt); // Test ==> minAlarmAnInt Real alertAnInt * 60 Intent objIntent = new Intent(PersonalActivity.this, MainActivity.class); startActivity(objIntent); } // if } // clickSavePersonal
private void testAddValue() { ManageTABLE objManageTABLE = new ManageTABLE(this); objManageTABLE.addNewValue( "user", "history", "used", "Allerties", "Resistance", "MyDrug", "Alert"); }