Android源代码语言设置解析
当用户在设置Android系统语言的时候,通常会进行如下操作Settings -> Language & keyboard -> Select language”。在设置语言时会使用LocalePicker.java其中对应的源
代码如下:
public class LocalePicker extends ListFragment {
private static final String TAG = "LocalePicker";
private static final boolean DEBUG = false;
private static final String[] pseudoLocales = { "en-XA", "ar-XB" };
public static interface LocaleSelectionListener {
// You can add any argument if you really need it...
public void onLocaleSelected(Locale locale);
}
LocaleSelectionListener mListener; // default to null
/**
* 不管是更改一种语言还是更改多种语言其实质都是调用
* updateLocales(LocaleList)方法
* @see #updateLocales(LocaleList)
*/
public static void updateLocale(Locale locale) {
updateLocales(new LocaleList(locale));
}
/**
* 通过getService方法获得Activit