android - Working with delay in Java -


i'm trying create speech recognition app app recieves voice , sends out stuff. i'd onendofspeech method called wait second , entire voice recognition intent start on again.

public void onendofspeech() {     log.d("speech", "onendofspeech");           try {             thread.sleep(3000);         } catch (interruptedexception e) {             // todo auto-generated catch block             e.printstacktrace();             mspeechrecognizer.startlistening(mspeechrecognizerintent);         } 

not sure doing correctly. thanks!

this how should

try {      thread.sleep(3000);      mspeechrecognizer.startlistening(mspeechrecognizerintent); } catch (interruptedexception e) {      // depends on app logic interruptedexception, can process or rethrow or restore interrupted flag } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -