I am trying to override onBackPressed() to send data to the previous screen in an intent like so;

```
    thisUserObj = (User) getIntent().getSerializableExtra("UserObj");

    Intent intent = new Intent();
    intent.putExtra("UserObj", thisUserObj);
    setResult(RESULT_OK, intent);

```

but when the button is pressed the UserObj values is null, however this works from a onClickListener

```
    Intent intent = new Intent(getApplication(), MainMenuActivity.class);
    intent.putExtra("UserObj", thisUserObj);
    startActivity(intent);

```