修改点packages/apps/Settings
diff --git a/res/drawable/ic_settings_backkey.xml b/res/drawable/ic_settings_backkey.xml
new file mode 100644
index 0000000000..f5a2f00f21
--- /dev/null
+++ b/res/drawable/ic_settings_backkey.xml
@@ -0,0 +1,25 @@
+<!--
+ Copyright (C) 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0"
+ android:tint="?android:attr/colorControlNormal">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
+</vector>
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
old mode 100644
new mode 100755
index e35a404dc2..1bf17b077d
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -20,6 +20,13 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="top_level_settings">
+ <Preference
+ android:key="level_back_key"
+ android:title="@string/wizard_back"
+ android:summary="@string/wizard_back"
+ android:icon="@drawable/ic_settings_backkey"
+ android:order="-160"/>
+
<com.android.settings.widget.HomepagePreference
android:fragment="com.android.settings.network.NetworkDashboardFragment"
android:icon="@drawable/ic_settings_wireless"
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index b7a04575e9..91ebedbdfa 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -252,6 +252,10 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
public boolean onPreferenceTreeClick(Preference preference) {
final Collection<List<AbstractPreferenceController>> controllers =
mPreferenceControllers.values();
+ if(preference.getKey().equals("level_back_key")){
+ Log.e(TAG, "click level_back_key ....");
+ finish();
+ }
for (List<AbstractPreferenceController> controllerList : controllers) {
for (AbstractPreferenceController controller : controllerList) {
if (controller.handlePreferenceTreeClick(preference)) {

如上所示,设置界面新增一个返回菜单

472

被折叠的 条评论
为什么被折叠?



