diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 83ac173..7cdf781 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -737,7 +737,13 @@
      */
     public void startPreferencePanel(String fragmentClass, Bundle args, int titleRes,
             CharSequence titleText, Fragment resultTo, int resultRequestCode) {
-        switchToFragment(fragmentClass, args, resultTo, resultRequestCode, titleRes, titleText);
+        String title;
+        if (titleRes > 0) {
+            title = getString(titleRes);
+        } else {
+            title = titleText.toString();
+        }
+        startWithFragment(fragmentClass, args, resultTo, resultRequestCode, title);
     }
 
     /**
@@ -773,41 +779,6 @@
     }
 
     /**
-     * Start a new fragment. Used by #startPreferencePanel.
-     *
-     * @param fragmentName The name of the fragment to display.
-     * @param args Optional arguments to supply to the fragment.
-     * @param resultTo Option fragment that should receive the result of
-     *                 the activity launch.
-     * @param resultRequestCode If resultTo is non-null, this is the request code in which to
-     *                          report the result.
-     * @param titleRes Resource ID of string to display for the title of. If the Resource ID is a
-     *                 valid one then it will be used to get the title. Otherwise the titleText
-     *                 argument will be used as the title.
-     * @param titleText string to display for the title of.
-     */
-    private void switchToFragment(String fragmentName, Bundle args, Fragment resultTo,
-            int resultRequestCode, int titleRes, CharSequence titleText) {
-        final CharSequence cs;
-        if (titleRes != 0) {
-            cs = getText(titleRes);
-        } else {
-            cs = titleText;
-        }
-
-        Fragment f = Fragment.instantiate(this, fragmentName, args);
-        if (resultTo != null) {
-            f.setTargetFragment(resultTo, resultRequestCode);
-        }
-        FragmentTransaction transaction = getFragmentManager().beginTransaction();
-        transaction.replace(R.id.prefs, f);
-        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
-        transaction.addToBackStack(BACK_STACK_PREFS);
-        transaction.setBreadCrumbTitle(cs);
-        transaction.commitAllowingStateLoss();
-    }
-
-    /**
      * Switch to a specific Fragment with taking care of validation, Title and BackStack
      */
     private Fragment switchToFragment(String fragmentName, Bundle args, boolean validate,
