code: private void init() {
  
          mTextToSpeech = new TextToSpeech(mContext, new OnInitListener() {
  
              @Override
              public void onInit(int status) {
  
                  if (status == TextToSpeech.SUCCESS) {
                      checkCurrentLocale();
                      int result = mTextToSpeech.setLanguage(mLocale);
  
                      if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
                          mLocale = getDefaultLocale();
                          init();
                          Log.i(TAG, "set default locale (English US) for gvrAccessibility");
                      }
                  }
              }
          });
  
      }
docs: Initialize {@code TextToSpeech} and treats unsupported languages exceptions by setting a default language.