The code was using global variables that were refreshed from the prefs on
certain occasions. That means that the global vars could easily get out of
sync with the actual values. Instead, just read the prefs directly when
the values are needed, and they will always be up-to-date.
This leaves the default Locale unchanged, i.e. Locale.setDefault(). This
also will immediately change the language after the user selects it in the
pref.
The Languages utility class merges the techniques from ChatSecure and
Courier. It fetches the supported locales from the APK itself, and fetches
the native names of the languages from the system.