title: Converting text to speech
body: <p>I am using the following code. Its working fine except a problem that i have list of text to converted as speech. But its only converting last line as a speech. Here is my code where I am putting data in listview and trying to convert it into speech:</p>
  
  <pre><code>  public class TextSpeech extends ListActivity implements
    TextToSpeech.OnInitListener {
    /** Called when the activity is first created. */
  
   private TextToSpeech tts;
  
   private TextView txtText;
   private List&lt;Message&gt; mess;
   List&lt;String&gt; titless;
  
  @SuppressLint("NewApi")
  @Override
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.speach);
  
   tts = new TextToSpeech(this, this);
  
  
   BaseFeedParser parser = new BaseFeedParser();
   mess = parser.parse();
   titless = new ArrayList&lt;String&gt;(mess.size());
      speakOut();
  }
  
  @SuppressLint("NewApi")
   @Override
   public void onDestroy() {
   // Don't forget to shutdown tts!
   if (tts != null) {
  tts.stop();
  tts.shutdown();
    }
  super.onDestroy();
    }
  
  
  @SuppressLint("NewApi")
  @Override
  public void onInit(int status) {
  
  if (status == TextToSpeech.SUCCESS) {
  
  int result = tts.setLanguage(Locale.US);
  
  if (result == TextToSpeech.LANG_MISSING_DATA
          || result == TextToSpeech.LANG_NOT_SUPPORTED) {
      Log.e("TTS", "This Language is not supported");
  } else {
  
      speakOut();
  }
  
      } else {
  Log.e("TTS", "Initilization Failed!");
      }
  
     }
  
     public void speakOut() {
       for (Message msg : mess){
   titless.add(msg.getTitle());
   tts.speak(msg.getTitle(), TextToSpeech.QUEUE_FLUSH, null);
           }
       ArrayAdapter&lt;String&gt; adapter = 
       new ArrayAdapter&lt;String&gt;(this, R.layout.row,titless);
       this.setListAdapter(adapter);
        }
       }
  </code></pre>