PauloAndrade
PauloAndrade

Reputation: 27

What the best delay to put on this task of my app?

I'm using Text to Speech on my app. After the google woman speak, a dailog box must be opened. The issue is: the dialog box open during the speech of the woman. So that's why I want to put a delay between the end of voice and the opening of the dailog box. I saw in several tutorials something about timesleep, handle, looper, thread and AsyncTask and I have a question: To my situation, what's the best way to aplicate? Thanks in advance.

Upvotes: 1

Views: 41

Answers (1)

TarcanGul
TarcanGul

Reputation: 24

In your case, I think AsyncTask will work best because of two reasons.

  • The women speaking part seems like it is a CPU-heavy process, thus it should be handled in a separate thread other than the UI Thread.
  • You can put your dialog on OnPostExecute() call and that call will trigger after the AsyncTask is done.

Hope it helps! Have fun.

Upvotes: 1

Related Questions