To call an Activity after the text has spoken in the current activity in Android text to speech app -


I'm new to Android; Can someone help me with the following requirement; To call an activity after the speech of the current activity is completed

The activity of 2 is read after the completion of the activity 1 but activity 2 activity 1 was started before the completion of the lesson is. This statement ID is not even identified.

I have written the code as follows. Any help would be appreciated. Thank you.

  Intake on public zero {if (position == TextToSpeech.SUCCESS) {string text = tt.getText (). ToString (); If (text! = Null & text.length () & gt; {} {toast. Make Text (Activity 1.This, "Speaking:" + Text, Toast. LNNHHLLG). Show (); Tts.setOnUtteranceCompletedListener (this); Hashmap & lt; String, string & gt; MyHash = new Hashmap (); Tts.speak (text, textotowspeech .QUEUE_ADD, myHash); MyHash.put (TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "Done"); } And if (position == TextToSpeech.ERROR) {toast. Make text (fossil., "Error occurred while launching test-to-speech engine", toast. LNNHT_LOG). Show (); }}} Confused on public zeroes (string t) {if (t == "full") {intent i = new intent (this, activity 2. class); StartActivity (i); }}  

Speaking before entering the call Hasham . Try it:
  tts.setOnUtteranceCompletedListener (this); Hashmap & lt; String, string & gt; MyHash = new Hashmap (); MyHash.put (TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "Done"); Tts.speak (text, textotowspeech .QUEUE_ADD, myHash);    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -