I am trying to setResult after the BACK button was pressed. I call in onDestroy
Intent data = new Intent();
setResult(RESULT_OK, data)
But
If you want to set some custom RESULT_CODE in onBackPressed event then you need to first set the result and then call the super.onBackPressed() and you will receive the same RESULT_CODE in the caller activity's onActivityResult method
@Override
public void onBackPressed()
{
setResult(SOME_INTEGER);
super.onBackPressed();
}