The Android system is very convenient to use the localization system, it is enough to create a folder and in it a file with strings. But it is difficult to embed all possible languages into the application, and it would not be bad to give the user a choice of a language other than the standard one.
I will give an example of this situation:
The application has 2 languages standard English and Russian. This application was decided to be installed by a Ukrainian, whose apparatus is in Ukrainian, but he also knows Russian well, but not very good English. But Android, having discovered that there is no Ukrainian language in the application, will launch the application with the standard language, which in our situation is English, and in order to run the application in Russian, you need to change the system language, which is not very good.
There is a solution for this and many similar situations. In the settings, display the language selection item, which includes automatic language selection, English, Russian, etc. (depending on what is required).

Let's start writing.
1. You need to create an Application class and define it in the manifest in the appropriate application section in the android: name = "" parameter.
eg:
<application android:icon="@drawable/icon" android:label="@string/app_name" android:name="MyApplication" android:enabled="true"> </application>
(although some may already have this class)
2. Create a setting with the choice of language, for this we add in the settings file:
<ListPreference android:key="lang" android:title="@string/LangTitle" android:summary="@string/LangSummary" android:entries="@array/entries_lang" android:entryValues="@array/entryvalues_lang" android:dialogTitle="@string/LangDialogTitle" />
3. Add the necessary lines to the file with lines:
<string name="LangTitle"></string> <string name="LangDialogTitle"> :</string> <string name="LangSummary"> .\n .</string>
4. And in the file with arrays 2 text arrays:
<string-array name="entries_lang"> <item> </item> <item></item> <item></item> </string-array> <string-array name="entryvalues_lang"> <item>default</item> <item>en</item> <item>ru</item> </string-array>
5. In the created class in the onCreate method, we will declare a string variable “lang”, read a variable from the settings, change the configuration of the application, and a method that is called when the configuration changes, in which we change it again (without changing the language again, I did not want to change throughout the application ). As a result, we get the following class:
public class MyApplication extends Application { private SharedPreferences preferences; private Locale locale; private String lang; @Override public void onCreate() { preferences = PreferenceManager.getDefaultSharedPreferences(this); lang = preferences.getString("lang", "default"); if (lang.equals("default")) {lang=getResources().getConfiguration().locale.getCountry();} locale = new Locale(lang); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, null); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); locale = new Locale(lang); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, null); } }
6. After that, in order for the language to be applied, you need to completely restart the application (finish (); it will not help here, since it restarts only activation), for this I use the System.exit () command;
(In the example I made a restart point for the alarm clock).
7. In order that there are no problems in the network, it is advised in the manifest for each activity that uses localization:
android:configChanges="locale"
And also, so that the application is displayed correctly determine the supported screen sizes:
<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" />
This is the simple way to simplify the user's life.
')

Advantages of this approach:
-The user is given a choice of language.
Minuses:
-The need to specify in languages added languages.
As usual, the example of the source code application:
1.
The source code of the example ;
2.
Sample application (apk) .
PS What other way can you close the application completely (including Application), except for System.exit ()?