Code example for PreferenceCategory

Methods: setEnabled

0
 
    /** 
     * µ±¼ì²âµ½·þÎñÕýÔÚÔËÐÐʱËù×öµÄÊÂÇé 
     */ 
    private void onServiceRunning() { 
        configCategore.setEnabled(false);
        serviceSwitch.setChecked(true);
    } 
 
    /** 
     * µ±·þÎñֹͣʱ×öµÄÊÂÇé 
     */ 
    private void onServiceStopped() { 
        configCategore.setEnabled(true);
    } 
 
    @Override 
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
                                          String key) {
        if (key.equals(ServiceSwitch)) {
            serviceSwitch(sharedPreferences.getBoolean(ServiceSwitch, false));