title: Android Text To Speech Not Working
body: <p>I am Trying to Run a tts on a static String , But I'm not able to hear any output from TTS, Here's my code.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements 
  CircleMenu.OnItemClickListener,GoogleApiClient.OnConnectionFailedListener,
  TextToSpeech.OnInitListener{
      private static final String TAG = "MainActivity";
      RecyclerView recyclerView;
      MaterialDialog.Builder materialDialog;
      CardAdapter cardAdapter;
      private GoogleApiClient mGoogleApiClient;
      private FirebaseAuth mAuth;
      private FirebaseAuth.AuthStateListener mAuthStateListener;
      private static int RC_SIGNIN=0;
      ProgressDialog progressDialog;
      FirebaseClient firebaseClient;
      TextToSpeech textToSpeech;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          textToSpeech=new TextToSpeech(this,this);
          textToSpeech.speak("I am Supposed TO Shout",TextToSpeech.QUEUE_FLUSH,null,null);
      }
  
      @Override
      protected void onPause() {
          textToSpeech.stop();
          textToSpeech.shutdown();
          super.onPause();
      }
  
      @Override
      public void onInit(int status)
      {
          if(status==TextToSpeech.SUCCESS){
              Toast.makeText(this, "Your Device Is Not Missing TTS", Toast.LENGTH_SHORT).show();
  
              int language=textToSpeech.setLanguage(Locale.UK);
              if(language==TextToSpeech.LANG_MISSING_DATA || language==TextToSpeech.LANG_NOT_SUPPORTED)
              {
  
              }
          }
          else{
              Toast.makeText(this, "Your Device Is Missing TTS", Toast.LENGTH_SHORT).show();
          }
      }
  }
  </code></pre>
  
  <p>I dont know where I am Wrong, I looked for similar codes on github, they are exactly same as me like here <a href="http://www.survivingwithandroid.com/2015/02/android-text-to-speech-tts.html" rel="nofollow noreferrer">Credits:SurvingWithAndroid</a>
  But They Seem To Be working in my device</p>