I just had the exact same problem. I solved it by removing the Intent.FLAG_ACTIVITY_NEW_TASK flag from the intent used to call Activity B. You could also check if there is
singleInstance
or
singletop
in your manifest in Activity B.
"You can't use startActivityForResult() if your activity is being launched as a singleInstance or singleTop."
Source : Android - startActivityForResult immediately triggering onActivityResult