Is there any method that starts when it returns to activity?

This is the script. I just stopped the thread that pressed the back key to return to the previous action, only the problem is that I want to execute the method when this happens, so I thought I could override the method using something like this:

@Override protected void onResume() { super.onResume(); } 

But it seems to work when I start the activity. I want to have this functionality, but when I press the back key to return.

Sorry if that doesn't make sense, I don't really understand the terminology.

+4
source share
1 answer

According to the official documentation, onResume() is exactly what you want - it is always executed when the action comes to the forefront either along with onCreate() , or / or onStart() or separately, depending on the current state of the process and activity.

+9
source

Source: https://habr.com/ru/post/1385024/


All Articles