I have a question. I have a list view (A) and a details view (B).
On B, I have a "view list" button that will always take the user to the list. The thing is, I can get to B via a notification and not necessarily from A.
So when clicking B, I can't just use finish() because I could have come in from a notification, so I may need to start a new activity in some cases.
How do I reliably tell if I came in from A or from a notification so that I can take the right action.
Added to that, is this something I should be worrying about? Or is it ok just to start an activity every time. In the case where I bouncing between A -> B -> A -> B -> A -> B over and over... never once calling finish()... will that slow things down?
Thanks,
Gerard.
When you start Activity B with an intent add an extra and then check the state of extra in activity B. Here is an example using strings although you could use other variable types like a boolean or an int:
Then in Activity B you can get the extra variable with: