Complementing the answer from @Nishant,the best way to return the activity result is:
Intent returnIntent = getIntent();
returnIntent.putExtra("result",result);
setResult(RESULT_OK,returnIntent);
finish();
I was having problem with
new Intent();
Then I found out that the correct way is using
getIntent();
to get the current intent