setResult does not work when BACK button pressed.

Posted by alex2k8 on Stack Overflow See other posts from Stack Overflow or by alex2k8
Published on 2010-04-20T22:53:16Z Indexed on 2010/04/21 0:13 UTC
Read the original article Hit count: 504

Filed under:

I am trying to setResult after the BACK button was pressed. I call in onDestroy

Intent data = new Intent();
setResult(RESULT_OK, data) 

But when it comes to

onActivityResult(int requestCode, int resultCode, Intent data) 

the resultCode is 0 (RESULT_CANCELED) and data is 'null'.

So, how can I pass result from activity terminated by BACK button?

© Stack Overflow or respective owner

Related posts about android