EditText fd1 = (EditText)findviewById(R.id.fd1);
EditText fd2 = (EditText)findviewById(R.id.fd2);
EditText fd3 = (EditText)findviewById(R.id.fd3);
submitbtn.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
String field1 = fd1.getText.toString();
String field2 = fd2.getText.toString();
String field3 = fd3.getText.toString();
dh.insert_values(field1, field2, field3);
}
});
On submit insert values into the database as like this..
and in your datahelper class
public long insert_values(String fd1,String fd2,String fd3)
{
this.insertStmt.bindString(1, fd1);
this.insertStmt.bindString(2, fd2);
this.insertStmt.bindString(3, fd3);
return this.insertStmt.executeInsert();
}
4
solved How to save form data in database when submit button is clicked? [closed]