OnBackPressed how to find out what activity a user is coming from?

Hello!
Guys, please tell me, is there a way to programmatically determine what activity the user pressing the Back button (onBackPressed)

Ie for example there is one main activity and 5 PCs child so to speak.
The user moves from the home to the child and then turns back. And I need to determine what a child he came to update the content in the main activity according to the changes in the child.

Is it possible to do?
Thank you!
April 19th 20 at 12:10
2 answers
April 19th 20 at 12:12
Immediately comes to mind. You just override onBackPressed method when you want to start another Activity Intent pass him. Just add the name of the Activity in the option extras. Hope I helped
April 19th 20 at 12:14
to obtain results on onBackPressed this is a very, very bad idea
in short, we need more knoka type OK, and on onBackPressed waiver changes
Oh, and start using child statrtActivityForResult

Find more questions by tags Android