title: Language is not changing in AlertDialog when changing English to Arabic
body: <p>I am working on a application in which I have to change apps content from English to Arabic and vice versa.
  Language is being changed according to language selection in Activities and Fragments but sometimes its doesn't change in <code>AlertDialog</code>. Please suggest me what I am doing wrong.</p>
  
  <p>Below are the details.</p>
  
  <p><strong>Class &amp; Method to show dialog</strong></p>
  
  <pre><code>public class AlertDialogManager {
  public static void showAlertDialog(Context ctx, String message) {
      if (ctx == null) {
          return;
      }
      showAlertDialog(ctx, message, Gravity.CENTER);
  }
  
  public static void showAlertDialog(Context ctx, String message, int gravity) {
      try {
          AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
          builder.setMessage(message).setPositiveButton("OK",
                  new DialogInterface.OnClickListener() {
  
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          // TODO Auto-generated
                          // method stub
                          dialog.cancel();
                      }
                  });
          AlertDialog dialog = builder.show();
          TextView messageText = (TextView) dialog
                  .findViewById(android.R.id.message);
          messageText.setGravity(gravity);
      } catch (Exception e) {
          // TODO: handle exception
  
      }
  
  }
  }
  </code></pre>
  
  <p><strong>Method which is calling above method</strong></p>
  
  <pre><code>    @Override
  public void showAlert(String message) {
      if (!TextUtils.isEmpty(message)) {
          AlertDialogManager.showAlertDialog(MerchantLoginActivity.this, message);
      }
  }
  </code></pre>
  
  <p><strong>Method being used in every activity to change content's language</strong></p>
  
  <pre><code>   @Override
  protected void attachBaseContext(Context newBase) {
      Locale languageType = LanguageUtil.getLanguageType(newBase);
      super.attachBaseContext(LocaleContextWrapper.wrap(newBase, languageType));
  }
  </code></pre>
  
  <p><strong>Button click event on which language is being changed | MainActivity</strong></p>
  
  <pre><code>@OnClick(R.id.language_button)
  void onLanguageClicked(View view) {
  
      // Getting saved language
  
  
      currentLanguage = LocaleHelper.getLanguage(getBaseContext());
      String languageToLoad = (currentLanguage.equals(Language.ARABIC) ? Language.ENGLISH : Language.ARABIC); // your language
  
     Locale locale = new Locale(languageToLoad);
      Locale.setDefault(locale);
      Configuration config = new Configuration();
      config.setLocale(locale);
      getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
      LocaleHelper.setLocale(getApplicationContext(), languageToLoad);
      //LanguageUtil.changeLanguageType(getApplicationContext(), locale);
      FlooosyApplication.getInstance().setLanguage(languageToLoad);
      this.recreate();
      //onRestart();
  }
  </code></pre>
  
  <p><strong>onRestart() | MainActivity</strong></p>
  
  <pre><code>@Override
  protected void onRestart() {
      super.onRestart();
      if (locale.equals(Language.ARABIC))
          locale = Language.ENGLISH;
      else
          locale = Language.ARABIC;
      startActivity(new Intent(this, MainActivity.class));
      finish();
  }
  </code></pre>