android setting.apkインタフェースでメニューオプションを削除

38296 ワード

           ?        “  /  ”,“  /  ”    ,“  /    /XX”    ,“  /  /XX”    。      HTC g6,android 2.2   2.6.32.17。             ,       android 2.3,    4.0  。       2.2,    2.3      。
 
  
 
                                           
               ?       ,       。
 
  
         package/apps/Settings/ ,          ,      res   src            ,         ,         java      。             , src/com/android/settings/   Settings.java,           。
 
  
 
  

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);         addPreferencesFromResource(R.xml.settings);         int activePhoneType = TelephonyManager.getDefault().getPhoneType();

......

       ,addPreferencesFromResource(R.xml.settings);          R.xml.settings。  ,   。R      res   ,       ,   。 res/xml/     settings.xml,    。           。
 
  

xml version="1.0" encoding="utf-8"?>

    xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"     android:title="@string/settings_label"     android:key="parent">

                    android:title="@string/radio_controls_title"             settings:icon="@drawable/ic_settings_wireless">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.WirelessSettings" />                

                    settings:icon="@drawable/ic_settings_sound"             android:title="@string/sound_settings_title">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.SoundSettings" />        

       

                    settings:icon="@drawable/ic_settings_display"             android:title="@string/display_settings_title">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.DisplaySettings" />           

  

       

                    settings:icon="@drawable/ic_settings_security"             android:title="@string/security_settings_title"             android:key="security_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.SecuritySettings" />        

       

                    settings:icon="@drawable/ic_settings_applications"             android:title="@string/applications_settings"             android:key="applications_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.ApplicationSettings" />        

       

                    settings:icon="@drawable/ic_settings_sync"             android:title="@string/sync_settings"             android:key="sync_settings">             android:action="android.settings.SYNC_SETTINGS" />        

       

                    settings:icon="@drawable/ic_settings_privacy"             android:title="@string/privacy_settings"             android:key="privacy_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.PrivacySettings" />        

       

                    settings:icon="@drawable/ic_settings_storage"             android:title="@string/storage_settings">             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.deviceinfo.Memory" />        

       

                    settings:icon="@drawable/ic_settings_language"             android:title="@string/language_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.LanguageSettings" />        

       

                    settings:icon="@drawable/ic_settings_speech"             android:title="@string/voice_input_output_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.VoiceInputOutputSettings" />        

               

                    android:key="dock_settings"             settings:icon="@drawable/ic_settings_dock"             android:title="@string/dock_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.DockSettings" />        

       

                    settings:icon="@drawable/ic_settings_date_time"             android:title="@string/date_and_time_settings_title">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.DateTimeSettings" />        

 

       

                    settings:icon="@drawable/ic_settings_about"             android:title="@string/about_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.DeviceInfoSettings" />        

    boss      。             ,  ,  ,  ,   ,     。
 
  

                ,                 ,       。 Settings.xml         。
 
  
 
  

                    settings:icon="@drawable/ic_settings_about"             android:title="@string/about_settings">                             android:action="android.intent.action.MAIN"                 android:targetPackage="com.android.settings"                 android:targetClass="com.android.settings.DeviceInfoSettings" />        


  intent     ,          ,                ,  android:targetClass="com.android.settings.DeviceInfoSettings"  ,        ,  com.android.settings.DeviceInfoSettings        。  \src\com\android\settings\eviceInfoSettings.java            。         :
       ,addPreferencesFromResource(R.xml.device_info_settings);           。
 
  
 
  

    @Override     protected void onCreate(Bundle icicle) {         super.onCreate(icicle);

        addPreferencesFromResource(R.xml.device_info_settings);

......

                ,           Preference,     ,           。
 
  
 
  

xml version="1.0" encoding="utf-8"?>

xmlns:android="http://schemas.android.com/apk/res/android"         android:title="@string/about_settings">

                android:key="system_update_settings"                 android:title="@string/system_update_settings_list_item_title"                 android:summary="@string/system_update_settings_list_item_summary">             android:action="android.settings.SYSTEM_UPDATE_SETTINGS" />                               ......

      “  /  /        ”,       ,    ,  ,     “...   ,        ,   ..."     ,                 ,       。  java  。android:targetClass="com.android.settings.DisplaySettings"           。
 
 
  

@@ -74,8 +74,8 @@ public class DisplaySettings extends PreferenceActivity implements            mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS);          mAnimations.setOnPreferenceChangeListener(this); -        mAccelerometer = (CheckBoxPreference)findPreference(KEY_ACCELEROMETER); -        mAccelerometer.setPersistent(false); +        //mAccelerometer = (CheckBoxPreference)findPreference(KEY_ACCELEROMETER); +        //mAccelerometer.setPersistent(false);          HdmiState = new File("/sys/class/hdmi/hdmi-0/state");            ListPreference screenTimeoutPreference = @@ -174,9 +174,9 @@ public class DisplaySettings extends PreferenceActivity implements          }          mAnimations.setValueIndex(idx);          updateAnimationsSummary(mAnimations.getValue()); -        mAccelerometer.setChecked(Settings.System.getInt( -                getContentResolver(), -                Settings.System.ACCELEROMETER_ROTATION, 0) != 0); +        //mAccelerometer.setChecked(Settings.System.getInt( +                //getContentResolver(), +                //Settings.System.ACCELEROMETER_ROTATION, 0) != 0);      }

         ,       。     adb           ,         。            , adb         。
 
  
        ,         settings      ,  !