I have an activity in which there is a continuous updation of display on the screen and also updation of text to speech. The problem here is while the UI is updating, if I press home button then also the text to speech is not stopped. It is running continuously. I have tried to write the stop()
and also shutdown()
in pause()
and also in destroy()
but still its not working. Can anyone please let me know how to stop that?
Please help me.
Thanks a lot.
It is hard to tell without looking at your code what you are doing wrong, but you should be able to call TextToSpeech.stop() or TextToSpeech.shutdown() in your onPause
and make that work. It is possible the stop fails for any number of reasons, and if it does then you're just out of luck. This works for me consistently on 6 different models of Android device (mTts
is my TextToSpeech
instance):
@Override
protected void onStop()
{
super.onStop();
if(mTts != null){
mTts.shutdown();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With