diff options
Diffstat (limited to 'src/com/android/calendar/OtherPreferences.java')
-rw-r--r-- | src/com/android/calendar/OtherPreferences.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/calendar/OtherPreferences.java b/src/com/android/calendar/OtherPreferences.java index 6f9ed2f1..45aebd7a 100644 --- a/src/com/android/calendar/OtherPreferences.java +++ b/src/com/android/calendar/OtherPreferences.java @@ -16,8 +16,12 @@ package com.android.calendar; +import android.content.ComponentName; +import android.content.Intent; import android.os.Bundle; +import android.preference.Preference; import android.preference.PreferenceFragment; +import android.preference.PreferenceScreen; public class OtherPreferences extends PreferenceFragment { // The name of the shared preferences file. This name must be maintained for @@ -27,6 +31,8 @@ public class OtherPreferences extends PreferenceFragment { public static final String KEY_OTHER_1 = "preferences_tardis_1"; + private Preference mCopyDb; + public OtherPreferences() { } @@ -35,5 +41,19 @@ public class OtherPreferences extends PreferenceFragment { super.onCreate(icicle); getPreferenceManager().setSharedPreferencesName(SHARED_PREFS_NAME); addPreferencesFromResource(R.xml.other_preferences); + mCopyDb = findPreference("preferences_copy_db"); + } + + @Override + public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) { + if (preference == mCopyDb) { + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.setComponent(new ComponentName("com.android.providers.calendar", + "com.android.providers.calendar.CalendarDebugActivity")); + startActivity(intent); + } else { + return super.onPreferenceTreeClick(screen, preference); + } + return true; } }
\ No newline at end of file |