Using the following code you can detect if the App comes foreground.
Read moreHow does a app run in a foreground?
An app’s transition to the foreground is usually in response to a user action . For example, when the user taps the app’s icon, the system launches the app and brings it to the foreground. Use a foreground transition to update your app’s UI, acquire resources, and start the services you need to handle user requests.
Read moreWhat does foreground mean in apps?
Foreground refers to the active apps which consume data and are currently running on the mobile . Background refers to the data used when the app is doing some activity in the background, which is not active right now.27 Şub 2019
Read more