I have a editText and a button, if i type "abc" and hit the button it will store the value in my database and will open a dielog box saying it got insert successfully but in the dialog box i also want to show what got insert, so heres the code:
EditText texto = (EditText) findViewById(R.id.etAdd);
final String resultado = texto.getText().toString();
Button add = (Button) findViewById(R.id.bAdd);
add.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
try {
//Abre ou Cria uma database com nome de: "dbtest.db"
db = openOrCreateDatabase("dbtest.db", Context.MODE_PRIVATE, null);
try {
db.insert("usuarioorigem", resultado, null);
ShowMessage("Mensagens","Inserido" +resultado+ "com sucesso!");
} finally {
}
} finally {
}
}
});