So what I'm trying to do is make it so the user is not able to go back to the previous activity without clicking the "save" button. I just don't know how to implement a back button exception sort of thing. Why I'm wanting to do this is because when they click the back button the edit text in which they are inputting information is still being saved to the sql database. Here is my code for the button.
saveItemButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
if (isEmpty(mTitleText)) {
mTitleText.getText().toString();
makeToast();
} else {
setResult(RESULT_OK);
finish();
}
}
});