Text to speech with highlight
<p>i need to highlight the text which is tts engine speaking.pls help me
this my code .pls help me</p>

<pre><code>public class TexttoSpeechActivity extends Activity implements OnInitListener {
/** Called when the activity is first created. */

private TextToSpeech tts;
private Button btnSpeak;
private EditText txtText;
private TextView Text;
private String[] find= {"this", "my", "document", "this", "valid"," one", "this", "how"," we", "work" ,"together"};
private CharSequence m="this my document this valid one this how we work together"; 

@Override
public void onCreate(Bundle savedInstanceState) 
    {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    tts = new TextToSpeech(this, this);
    btnSpeak = (Button) findViewById(R.id.btnSpeak);
    txtText = (EditText) findViewById(R.id.txtText);
    Text = (TextView) findViewById(R.id.Text);
    Text.setText(m);
    btnSpeak.setOnClickListener(new View.OnClickListener()

    {

        public void onClick(View arg0) {
            speakOut();
        }

    });
}

@Override
public void onDestroy() {
    // Don't forget to shutdown!
    if (tts != null) {
        tts.stop();
        tts.shutdown();
    }
    super.onDestroy();
}

public void onInit(int status) {
    // TODO Auto-generated method stub

    if (status == TextToSpeech.SUCCESS) {

        int result = tts.setLanguage(Locale.US);

        if (result == TextToSpeech.LANG_MISSING_DATA
                || result == TextToSpeech.LANG_NOT_SUPPORTED) {
            Toast.makeText(this, "Language not supported", Toast.LENGTH_LONG).show();
            Log.e("TTS", "Language is not supported");
        } else {
            btnSpeak.setEnabled(true);

        }

    } else {
        Log.e("TTS", "Initilization Failed");
    }

}

private void speakOut() {

    String text = txtText.getText().toString();
    for(int i=0;i&lt;find.length;i++)
    {
    if (text.equals(find[i])) {
        tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
    Text.setText(Text.getText(), TextView.BufferType.SPANNABLE);
    Spannable op = (Spannable)Text.getText();
    op.setSpan(new BackgroundColorSpan(0xFFFFFF00), 0, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    Text.setText(op);
    } else {
        tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
    }
    }
}
</code></pre>

<p>}</p>
