Answer the question
In order to leave comments, you need to log in
OnBackPressed, how to find out which activity the user came from?
Hello!
Guys, tell me please, is it possible to somehow programmatically determine with which activity the user came by pressing the "Back" button (onBackPressed)
Ie . For example, there is one main activity and 5 child ones, so to speak.
The user from the main goes to the child and then comes back. And I need to determine which child it came from in order to update the content in the main activity according to its changes in the child.
Is it possible to do this?
Thank you!
Answer the question
In order to leave comments, you need to log in
Immediately comes to mind. You just override when the onBackPressed method you pass an Intent to start another Activity. Just add the name of the Activity to the extras parameter. I hope it helped
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question