android studio - TTS Task Option -
i have activity signals service (intentservice) various operations. activity might stop running service carries on until data processed. @ various points, service needs tts speak. service cannot tts speak initialization intentservice , cannot safely register listeners task needs written.
my question is, form should new task take? needs to:
- process tts speak requests service
- do tts.shutdown release tts resources when nothing remains done
- safely register tts oninit listener
the first 2 requirements indicate task should have message handler.
one option can think of use thread. not sure if thread can support handler , not know how run() method should handled.
i relatively new android. have programed thread, intentservice , activities in project, unsure go these requirements.
i wrote bound service gets messages intentservice. achieves requirements without message handler.