TextToSpeech OnUtteranceCompletedListener not working
<p>I'm using OnUtteranceCompletedListener to detect when TTS is finished speaking, however OnUttereanceCompleted is never called. The listener is created in onInit, before HashMap, so I don't know what's wrong. Any idea?</p>

<pre><code>    public class TTSActivity extends Activity implements TextToSpeech.OnInitListener, OnUtteranceCompletedListener
{
    private TextToSpeech tts;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tts_layout);

        tts = new TextToSpeech(this, this);
    }



    @Override
    public void onDestroy() {
        // Don't forget to shutdown tts!
        if (tts != null) {
            tts.stop();
            tts.shutdown();
        }
        super.onDestroy();
    }

    @Override
    public void onInit(int status) 
    {
        if (status == TextToSpeech.SUCCESS) 
        {
            tts.setOnUtteranceCompletedListener(this);
            int result = tts.setLanguage(Locale.US);

            if (result == TextToSpeech.LANG_MISSING_DATA
                    || result == TextToSpeech.LANG_NOT_SUPPORTED) {
                Log.e("TTS", "This Language is not supported");
            } else {
                speakOut();
            }
        } else {
            Log.e("TTS", "Initilization Failed!");
        }

    }

    private void speakOut() 
    {
        HashMap&lt;String, String&gt; myHashAlarm = new HashMap&lt;String, String&gt;();
        myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_ALARM));
        myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "FINISHED PLAYING");
    tts.speak("Some text.", TextToSpeech.QUEUE_FLUSH, myHashAlarm);   
  }

    @Override
    public void onUtteranceCompleted(String utteranceId) 
    {
        if(utteranceId=="FINISHED PLAYING")
        {
            Log.i("TTS", "Called");   //never called
        }   
    }
</code></pre>
