In my main activity, I have:
Intent settings_intent = new Intent(this, SettingsActivity.class);
settings_intent.putExtra("SomeID", some_int);
startActivityForResult(settings_intent, 1);
And then, in my SettingsActivity, I have:
@Override
public void onBackPressed() {
super.onBackPressed();
// pass back settings:
Intent data = new Intent();
data.putExtra("SomeThing", some_number);
setResult(200, data);
finish();
}
And finally, I overrode the following in my Main activity:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
makeToast("called");
super.onActivityResult(requestCode, resultCode, data);
}
However, the "called" toast happens as soon as my "Settings" activity starts, instead of when it finishes. I've spent quite a while on this now. Any help is appreciated. Thanks.