Locale.getDefault() - How to Get the User's Preferred Locale

public static Locale getDefault () was added in API level 1
Returns the user's preferred locale. This may have been overridden for this process with setDefault(Locale).
Since the user's locale changes dynamically, avoid caching this value. Instead, use this method to look it up for each use.

1. In the MainActivity.java file, add the below import to the imports section. 

import java.util.Locale;

2. In the onCreate method, to test, add the following Toast to display the user's preferred locale.

Toast.makeText(getBaseContext(), Locale.getDefault().toString(), Toast.LENGTH_LONG).show();

3. Compile and run!

4. This will display the users preferred locale. In my case it display mine as: