Emmy
Emmy

Reputation: 3999

How to stop Android TextToSpeech when there is a phone call come in

My android app got rejected by Amazon because of this reason.

I have this TextToSpeech playing while the phone call come in. They wanted me to stop playing. How do I do that?

Upvotes: 1

Views: 115

Answers (1)

Hoan Nguyen
Hoan Nguyen

Reputation: 18151

In your service or activity that implement TextToSpeech register for PhoneStateListener and in your PhoneStateListener in onCallStateChanged call the TextToSpeech class stop() method for state = TelephonyManager.CALL_STATE_RINGING.

Upvotes: 2

Related Questions