我正在尝试在textToSpeech运行时更改textView背景。 但是,我的代码在textToSpeech完成讲话后更改了textView背景。
Log.i(TAG, "Inside else block of play");
Handler mainHandler = new Handler(mAppContext.getMainLooper());
Runnable myRunnable = new Runnable() {
@Override
public void run() {
textView.setBackgroundColor(Color.BLUE);
}
};
speakOut(word);
do {
mainHandler.post(myRunnable);
} while (tts.isSpeaking());