Maurix
Maurix

Reputation: 742

Android: access the Activity stack programmatically

is it possibile to get the current Activity stack from code?

Here is my use case:

A -> B -> c -> D -> ...

Thanks in advance,

Bye, Maurizio

Upvotes: 5

Views: 6244

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40347

My impression is that the answer to the literal question is "no" - you cannot access that. But there's probably another way to accomplish what you need.

If these are all your activities, why not put an extra in the Intent (when going in the forward direction) which says which activity it is coming from.

You can then decide which back button image to display based on checking that extra, which should tell you what the previous activity was (if it was one of yours - if it's empty you have to assume it came from somewhere else in the system)

Upvotes: 4

Related Questions