diff --git a/src/com/android/email/activity/setup/AccountSettingsFragment.java b/src/com/android/email/activity/setup/AccountSettingsFragment.java index cf9a85028..ca7ae03fb 100644 --- a/src/com/android/email/activity/setup/AccountSettingsFragment.java +++ b/src/com/android/email/activity/setup/AccountSettingsFragment.java @@ -35,6 +35,7 @@ import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.Preference.OnPreferenceClickListener; +import android.preference.PreferenceFragment; import android.provider.CalendarContract; import android.provider.ContactsContract; import android.provider.Settings; @@ -76,7 +77,7 @@ import java.util.Map; * TODO: Can we defer calling addPreferencesFromResource() until after we load the account? This * could reduce flicker. */ -public class AccountSettingsFragment extends EmailPreferenceFragment +public class AccountSettingsFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener { // Keys used for arguments bundle @@ -200,6 +201,8 @@ public class AccountSettingsFragment extends EmailPreferenceFragment } super.onCreate(savedInstanceState); + setHasOptionsMenu(true); + // Load the preferences from an XML resource addPreferencesFromResource(R.xml.account_settings_preferences); diff --git a/src/com/android/email/activity/setup/EmailPreferenceFragment.java b/src/com/android/email/activity/setup/EmailPreferenceFragment.java deleted file mode 100644 index 9f379f873..000000000 --- a/src/com/android/email/activity/setup/EmailPreferenceFragment.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - -package com.android.email.activity.setup; - -import android.os.Bundle; -import android.preference.PreferenceFragment; -import android.view.Menu; -import android.view.MenuInflater; - -public class EmailPreferenceFragment extends PreferenceFragment { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setHasOptionsMenu(true); - } - - @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - //*** - //if (!UiUtilities.useTwoPane(getActivity())) { - // menu.clear(); - //} - } -} diff --git a/src/com/android/email/activity/setup/GeneralPreferences.java b/src/com/android/email/activity/setup/GeneralPreferences.java index d485c258b..d263f1939 100644 --- a/src/com/android/email/activity/setup/GeneralPreferences.java +++ b/src/com/android/email/activity/setup/GeneralPreferences.java @@ -22,6 +22,7 @@ import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; import android.text.TextUtils; import android.view.Menu; @@ -34,7 +35,7 @@ import com.android.email.provider.EmailProvider; import com.android.mail.preferences.MailPrefs; import com.android.mail.ui.settings.ClearPictureApprovalsDialogFragment; -public class GeneralPreferences extends EmailPreferenceFragment implements +public class GeneralPreferences extends PreferenceFragment implements OnPreferenceChangeListener { private static final String PREFERENCE_KEY_AUTO_ADVANCE = "auto_advance"; @@ -67,6 +68,7 @@ public class GeneralPreferences extends EmailPreferenceFragment implements @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setHasOptionsMenu(true); mMailPrefs = MailPrefs.get(getActivity()); getPreferenceManager().setSharedPreferencesName(Preferences.PREFERENCES_FILE);