I am switching application language English to Arabic and vice versa from a fragment.
The code below works, it loads the values-ar\strings.xml and the language is changed from english to arabic. The app's UI elements doesn't change immediately based on the updated language settings, **RTL alignment**. The change is only reflected when application is closed and reopened.

```
Locale locale = new Locale("ar");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getActivity().getResources().updateConfiguration(config, getActivity().getResources().getDisplayMetrics());
getActivity().recreate()

```