how can i figure out which Activity will be next in the onStop() method of the current Activity after onStop() gets called by launching a new Activity with startActivity()?
My only idea at the moment: Declaring the intent i use as a global variable and checking it in the onStop() method with intent.getClass() or something similar. Would this be ok? Somehow feels like the quick and dirty approach.
Thanks for any help!
Edit: So here is the scenario:
Activity1 is a listview where the user selects one or more lines and then clicks "submit", all selected lines are now submitted to a server in a background task.
I use an array in my service to store the selected id's before submissin so if the user leaves the listview without hitting submit this array would still be filled with outdated selections.
So if the User selects one or more line and then exits Activity1 without "submitting" i want the selection to be discarded, so i do call a method to clear that array in the onStop() method of Activity1. This works good, but of course there are different ways to leave Activity1. For example i do have a context menu with 3 entries and every one of those starts another activity.
Now i need to keep my array values in case of just one special single activity (let's say Activity2) from the context menu is selected.
Sorry if that was not clear but i am not talking about activity instances but about the kind of activity in general.
So all i need to know in the onStop() method is if we have switched to Activity2.java or Activity3.java from Activity1.
Maybe that onStop() of Activity1 even isn't the right place for my clear or not clear decision?
Thanks again