- Home /
Android - OnPause() and OnResume() not working with OnApplicationFocus or OnApplicationPause?
I have a issue on android with my game still being active in the background and locked screen. This is quite annoying because the game will still play sounds even when the application is in the background and when the device is locked.
I've tried to mute sound with the OnApplicationFocus and OnApplicationPause() method but with no success. These two methods seems only to be called when I start the application and won't trigger when I put the game in the background of the device or bring it back to the foreground.
Any ideas how to solve this issue?
Answer by Slappiz · Dec 06, 2019 at 03:45 PM
This seems to be a build issue in Unity 2019. I upgraded to Unity 2020 and made a new build and that solved the issue.
Your answer
Follow this Question
Related Questions
OnApplicationPause & OnApplicationFocus 1 Answer
onApplicationPause / Focus not executing the full command | Mobile 0 Answers
problem with checking application states on android and windows 0 Answers
Detect Status Bar Expanding or Low Power Notification to Pause Game? 0 Answers
opposite of OnApplicationPause -1 Answers