protected void Save_Click(){ btnSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Author author = new Author(); author.setId_author(Integer.parseInt(txtID.getText() + "")); author.setName(txtName.getText() + ""); author.setAddress(txtAddress.getText() + ""); author.setEmail(txtEmail.getText() + ""); if (myDB_helper.insertAuthor(author) > 0){ Toast.makeText(getApplicationContext(), "Đã lưu thành công", Toast.LENGTH_LONG).show(); }else Toast.makeText(getApplicationContext(), "Lưu không thành công", Toast.LENGTH_LONG).show(); txtID.setText(""); txtName.setText(""); txtAddress.setText(""); txtEmail.setText(""); } }); }