I'm having an activity A which starts another activity B, I use the startActivityForResult method.
My plan is:
When I press Home button in activity B, I want Activity A to be killed as well.
In the onStop() of activity B, I tried setResult(1,mIntent) and in activity A, when request code ==1, I finish A.
However, when I press home button in B, the setResult method didn't get called.
I'm just wondering anybody knows why is that or is there another way to kill parent activity in child activity when home button pressed?
Try the onUserLeaveHint method:
It executes when the user forces an activity to stop by, for example, clicking the home button