TheMaoriFlash
TheMaoriFlash

Reputation: 31

Using multiple instances of startActivityForResult through a linked chain of Activities

I have 4 Activities.

Activity A is where I want multiple types of custom objects to end up for processing.

I used one instance of startActivityForResult to connect from Activity A to Activity B, and from there I use FLAG_ACTIVITY_FORWARD_RESULT when I connect to Activity C. I call this one more time to connect to Activity D.

I can get any of the custom objects back to Activity A easily using the setResult(), my problem is I want to be able to get a Custom Object from Activity D, back to Activity C. Can I use startActivityForResult again from C to D, and when I call setResult on Activity D, will it point back to Activity C or pass down the line due to FLAG_ACTIVITY_FORWARD_RESULT?

Upvotes: 0

Views: 97

Answers (1)

Maxim G
Maxim G

Reputation: 1489

Consider to use one host Activity as a navigation/task controller and multiple Fragments with callback results.

If you want to stick to Activities move all navigation logic to the root activity.

Upvotes: 1

Related Questions