Helper function added to check if app is in background on older Android versions.