Reputation: 8985
I have activities A and B. Activity B is started by a service while the application is closed and activity A is not on the stack. Activity A has members that B requires access to. I would also like the home button to open activity A from Activity B even if activity B is started from a service. Is there a way to inject activity A back into the stack?
Upvotes: 0
Views: 957
Reputation: 3004
That won't be a good decision, better use the members in the B Activity and Once Activity B is launched and it's about to leave just give intent to Activity A. Also you can check if Activity A is already in the stack. If already in the stack, it will popup by itself, if not found, can pro grammatically trigger it.
Upvotes: 0
Reputation: 3134
In your Service
start ActivityA
not ActivityB
and pass some parameter to ActivityA
.. and in ActivityA
's OnCraete
method launch the ActivityB
.. now you have both in the stack.
Upvotes: 2