By background, I mean none of the application\'s activities are currently visible to the user?
Offical docs:
The system distinguishes between foreground and background apps. (The definition of background for purposes of service limitations is distinct from the definition used by memory management; an app might be in the background as pertains to memory management, but in the foreground as pertains to its ability to launch services.) An app is considered to be in the foreground if any of the following is true:
If none of those conditions is true, the app is considered to be in the background.