Can I use startActivityForResult multiple times?
Can I use startActivityForResult multiple times??
I have 5 activites A,B,C,D,E
A->B->C--STARTACTIVITYFORRESULT->D---STARTACTIVITYFORRESULT--->D---SETRESULT-->D
--STARTACTIVITY-->E ---SETRESULT-->C
When i Call setresult from E it takes me back to D rather than C. Wh开发者_高级运维at should i do to make it redirect to ActivityC
Think of startActivityForResult
as a Stack.push
example
- You have activity A running
- You startActivityForResult activity B
- In activity B you startActivityForResult activity C
- In activity C you startActivityForResult activity D
At this point, in the stack: you have A-B-C-D
If D finishes, D is popped
and you return to C.
When C finishes, C is popped
and you return to B
Finally When B finishes, B is popped
and you return to A
精彩评论