FileDocCategorySizeDatePackage
CalendarPreferenceActivity.javaAPI DocAndroid 1.5 API3529Wed May 06 22:42:42 BST 2009com.android.calendar

CalendarPreferenceActivity

public class CalendarPreferenceActivity extends android.preference.PreferenceActivity implements android.content.SharedPreferences.OnSharedPreferenceChangeListener

Fields Summary
static final String
KEY_HIDE_DECLINED
static final String
KEY_ALERTS_TYPE
static final String
KEY_ALERTS_VIBRATE
static final String
KEY_ALERTS_RINGTONE
static final String
KEY_DEFAULT_REMINDER
static final String
KEY_START_VIEW
static final String
KEY_DETAILED_VIEW
static final String
ALERT_TYPE_ALERTS
static final String
ALERT_TYPE_STATUS_BAR
static final String
ALERT_TYPE_OFF
static final String
DEFAULT_START_VIEW
static final String
DEFAULT_DETAILED_VIEW
android.preference.ListPreference
mAlertType
android.preference.CheckBoxPreference
mVibrate
android.preference.RingtonePreference
mRingtone
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

    
    
        
        super.onCreate(icicle);
        
        // Load the preferences from an XML resource
        addPreferencesFromResource(R.xml.preferences);
        
        PreferenceScreen preferenceScreen = getPreferenceScreen();
        preferenceScreen.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
        mAlertType = (ListPreference) preferenceScreen.findPreference(KEY_ALERTS_TYPE);
        mVibrate = (CheckBoxPreference) preferenceScreen.findPreference(KEY_ALERTS_VIBRATE);
        mRingtone = (RingtonePreference) preferenceScreen.findPreference(KEY_ALERTS_RINGTONE);
        
        updateChildPreferences();
    
public voidonSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences, java.lang.String key)

        if (key.equals(KEY_ALERTS_TYPE)) {
            updateChildPreferences();
        }
    
private voidupdateChildPreferences()

        if (mAlertType.getValue().equals(ALERT_TYPE_OFF)) {
            mVibrate.setChecked(false);
            mVibrate.setEnabled(false);
            mRingtone.setEnabled(false);
        } else {
            mVibrate.setEnabled(true);
            mRingtone.setEnabled(true);
        }