user1704369
user1704369

Reputation: 153

Android TTS TextToSpeech Best Practice

I am aware of the lifecycle of TTS, Activity and Application. However I have a hard time making sure to release TTS after using it, especialy if a user presses Home and so on. I want an App that speaks during multiple Activities. I don't know how long my App needs to talk and during talking I need to update a View from time to time. Perhaps someone could point out a good example for best practice in handling the creation and releasing of my TTS Object.

Thank's in advance.

Upvotes: 1

Views: 706

Answers (1)

Hoan Nguyen
Hoan Nguyen

Reputation: 18151

You should create the Tts object in onStart() and shutdown Tts in onStop(). This way when your app is not visible, the TTS resources are not being used.

Upvotes: 1

Related Questions