I have the following case:
Activity A -> Activity B (noHistory set) -> Activity C
I need to have a result from C returned to A when C finishes. Is it possible?
The only way I could achieve this is by retaining the history for B and forwarding the result from C via it. Thus, though, if B is launched and the program is restored from background, B will be displayed. I would prefer that B is not kept on the stack.
As already confirmed by Kamen, FLAG_ACTIVITY_FORWARD_RESULT should be used in such a case. As tutorial says:
If set and this intent is being used to launch a new activity from an existing one, then the reply target of the existing activity will be transfered to the new activity. This way the new activity can call setResult(int) and have that result sent back to the reply target of the original activity.