I am working with TextToSpeech on Android to speak a sequence of texts. As it is a big string, I am using a new thread for this.
The problem is that when talkback speech accessibility is enabled, it stops reading my app to speak the notifications of the device, reads other buttons when the user touches the screen, etc.
I need to know when the talkback will speak, so I interrupt my thread and when the talkback finishes announcing whatever it is, my tts will be able to resume reading.
What is happening is that my tts reads line 1, line 2, line 3 (so talkback says something) and my tts did not read line 4, line 5 ... (...). It just resumes to speak after the talkback there to line 50, 60, since my repetition, that is in the thread, keeps running and the speaker is being occupied by the talkback.
Does anyone have any guidance / solution for this?