I created an application which uses Phone Call to do direct phone calls when active. It uses in particular the Event PhoneCallEnded to say something when the phone call is finished with the TTS functionnality.
The problem is that when I use the square or circle button in the lower part of my phone, my application is minimized but still running. So when the app is minimized, if I use my phone to call somebody, after hanging up, I can hear the TTS message from my app. This means that the PhoneCallEnded event was detected even when the app is minimized. Is there a way to prevent this behaviour and let my app detect the phone events only when it is maximised and in use ?
Thank you for your help.