private void installVoiceData(){
  if (TextUtils.isEmpty(getEngineName()))   return;
  Intent intent=new Intent(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  intent.setPackage(getEngineName());
  try {
    Log.v(TAG,"Installing voice data: " + intent.toUri(0));
    startActivity(intent);
  }
 catch (  ActivityNotFoundException ex) {
    Log.e(TAG,"Failed to install TTS data, no acitivty found for " + intent + ")");
  }
}

private void installVoiceData ( ) { if ( TextUtils . isEmpty ( getEngineName ( ) ) ) return ; Intent intent = new Intent ( TextToSpeech . Engine . ACTION_INSTALL_TTS_DATA ) ; intent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; intent . setPackage ( getEngineName ( ) ) ; try { Log . v ( TAG , "Installing voice data: " + intent . toUri ( 0 ) ) ; startActivity ( intent ) ; } catch ( ActivityNotFoundException ex ) { Log . e ( TAG , "Failed to install TTS data, no acitivty found for " + intent + ")" ) ; } }
ask the current default engine to launch the matching install_tts_data activity so the required tts files are properly installed .
