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:

  1. process tts speak requests service
  2. do tts.shutdown release tts resources when nothing remains done
  3. 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.


Popular posts from this blog