Android - How to activate the app
Look for a method
. It is always called when your application comes to the fore.
According to google docs :
The lifetime of a foreground object occurs between the call to onResume () until the corresponding call to onPause (). During this time, the activity is in front of all other activities and interacts with the User. Activity can often pass between resumed and suspended states - for example, when a device goes to sleep, when an activity is a result delivered, when a new intent is delivered, so the code in these methods should be light enough.
source to share