Locale is through the system settings of the region and Latin input language through the merger out, so in the system locale and input language support can be in the input language settings
Languagelist is read from the Latin_preferences.xml file that stores the Latin Input method settings, the input language that was last set
If you want to set a language in the input method by default open can click the steps to add files, I have been verified here OK, you can try.
Provide a simple sample code, such as the default Burmese, English, French input method tick:
1. Writing Document Latinimereceiver.java
Copy Code code as follows:
Package com.android.inputmethod.latin;
Import Android.content.BroadcastReceiver;
Import Android.content.Context;
Import android.content.Intent;
Import android.content.SharedPreferences;
Import Android.content.SharedPreferences.Editor;
Import Android.preference.PreferenceManager;
Import android.provider.Settings;
Import Android.util.Log;
Import Android.view.inputmethod.InputMethodInfo;
Import Android.view.inputmethod.InputMethodManager;
Import Android.view.inputmethod.InputMethodSubtype;
Import Android.text.TextUtils;
public class Latinimereceiver extends Broadcastreceiver {
private static final String TAG = LatinImeReceiver.class.getSimpleName ();
@Override
public void OnReceive (context context, Intent Intent) {
LOG.D ("Latinimereceiver", "Step1");
Sharedpreferences sp = context.getsharedpreferences ("Com.android.inputmethod.latin_preferences",
Context.mode_private);
Boolean hasset = Sp.getboolean ("Has_set", false);
if (!hasset) {
LOG.D ("Latinimereceiver", "Step2");
Editor Editor = Sp.edit ();
LOG.D ("Latinimereceiver", "step3");
Editor.putstring (Latinime.pref_selected_languages, "EN_US,MY,FR"); The default will be English, Burmese check, specific how to write can refer to the Inputlanguageselection.java in the Whitelist_languages
Editor.putboolean ("Has_set", true);
LOG.D ("Latinimereceiver", "Step4");
Editor.commit ();
Sharedpreferencescompat.apply (editor);
LOG.D ("Latinimereceiver", "step5");
}
}
Place it under the Path Packages/inputmethods/latinime/java/src/com/android/inputmethod/latin folder
2. Register intent, add in the last side of Packages/inputmethods/latinime/java/androidmanifest.xml:
and add <uses-permission android:name= "Android.permission.RECEIVE_BOOT_COMPLETED"/> Permissions
Copy Code code as follows:
<receiver android:name= "Latinimereceiver" android:enabled= "true" >
<intent-filter>
<action android:name= "Android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>