Stop PhoneCall activity when my app is minimized

Hello,

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.

You could use the ActivityStateChanged event of the tools extension https://puravidaapps.com/tools.php like this

If state = "stop"
then close application

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thank you for your help, it seems to work.

Regards.