how can I determine which function will be next in the onStop () method of the current Activity after onStop () is called by starting a new Activity with startActivity ()?
My only idea at the moment is: Declaring the intent, which I use as a global variable, and checking it in the onStop () method with the intent.getClass () function or something similar. Will it be okay? Somehow it seems fast and dirty.
Thanks for any help!
Edit: So here is the scenario:
Activity1 is a list in which the user selects one or more lines and then clicks "send", all selected lines are now sent to the server in the background job.
I use an array in my service to save the selected identifier before subsensing, so if a user leaves the list without getting into this array, it will still be filled with outdated choices.
So, if the user selects one or more rows and then leaves Activity1 without sending, I want the selection to be discarded, so I call the method to clear this array in the onStop () method of Activity1. This works well, but of course there are different ways to leave Activity1. For example, I have a context menu with 3 entries, and each of them triggers a different action.
Now I need to save the values โโof the array in case of only one special separate action (for example, Activity2) from the context menu.
Sorry if this was unclear, but I'm not talking about instances of activity, but about how to behave in general.
So, all I need to know in the onStop () method is if we switched to Activity2.java or Activity3.java from Activity1.
Maybe onStop () Activity1 is not even suitable for my clear or incomprehensible solution?
Thanks again