I want to execute a piece of code (say, for example, display Toast) every time the application is open. So far, I have done this every time the application starts, putting the code in my MyApp.java file, which extends the application.
However, if I click on the main screen or exit the application and then go to it, the message does not appear again. This only happens when I restart the application. Any idea how to do this?
EDIT: Basically, I ask how to execute the code every time the whole APP is brought to the forefront (this can be opened the first time after another application has been used, after the user has abandoned the application, etc. ) Where would I place the onResume code? This would not be in any specific action, if I wanted it to be applied when an integral application appeared in the foreground, and not just specific activity.
source
share