android - Intent within onUtteranceCompleted method not working -


i trying implement intent take user home screen once texttospeech function completes, isn't working, , i'm not sure why. here code:

public void playtext(){          string text = typenewmessageedittext.gettext().tostring();     hashmap<string, string> myhashrender = new hashmap<string, string>();     myhashrender.put(texttospeech.engine.key_param_utterance_id, "completed");     tts.speak(text, texttospeech.queue_flush, myhashrender);         }   @override public void onutterancecompleted(string utteranceid) {     if (utteranceid.equals("completed")){                    intent displaymainactivity = new intent (this, mainactivity.class);                 startactivity(displaymainactivity);     }    } 


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -