Even though I am setting it correctly:
HashMap<String, String> myHashRender = new HashMap<String, String>();
myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "utid");
mTts.speak("Speak something", TextToSpeech.QUEUE_ADD, myHashRender);
also
mTts.setOnUtteranceCompletedListener(this);
in the onInit function return success. Still the onUtteranceCompleted does not get called. Though there are duplicate questions, but no where I could find the answer.
My Activity also implements OnUtteranceCompletedListener.
Please help.
Call the setOnUtteranceCompletedListener inside the onInit function of the tts object.
If you want to make any changes to the UI on the call of the onUtteranceCompleted function, add the code inside a runOnUIThread method.
And do remember to add the Hashmap param value while calling the speak() function
Example :