Android7点开语言直接显示语言偏好设置
点开语言直接显示 语言偏好设置
其实很简单,一级界面和二级界面如下
<activity android:name="Settings$LocalePickerActivity"
android:label="@string/language_picker_title"
android:icon="@drawable/ic_settings_language"
android:taskAffinity="com.android.settings"
android:parentActivityName="Settings$InputMethodAndLanguageSettingsActivity">
<intent-filter android:priority="1">
<action android:name="android.settings.LOCALE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.localepicker.LocaleListEditor" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
<activity android:name="Settings$InputMethodAndLanguageSettingsActivity"
android:label="@string/language_keyboard_settings_title"
android:icon="@drawable/ic_settings_language"
android:taskAffinity="com.android.settings"
android:parentActivityName="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="-1">
<action android:name="com.android.settings.action.SETTINGS" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.personal" />
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.localepicker.LocaleListEditor" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
修改其FRAGMENT_CLASS即可
diff --git a/packages/apps/Settings/AndroidManifest.xml b/packages/apps/Settings/AndroidManifest.xml
index 6445e35..4253156 100755
--- a/packages/apps/Settings/AndroidManifest.xml
+++ b/packages/apps/Settings/AndroidManifest.xml
@@ -618,7 +618,7 @@
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.personal" />
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.inputmethod.InputMethodAndLanguageSettings" />
+ android:value="com.android.settings.localepicker.LocaleListEditor" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>