OSDN Git Service

Don't check for valid fragment when switching to another fragment
authorAmith Yamasani <yamasani@google.com>
Mon, 5 Aug 2013 17:55:28 +0000 (10:55 -0700)
committerAmith Yamasani <yamasani@google.com>
Mon, 5 Aug 2013 17:55:28 +0000 (10:55 -0700)
Bug: 10184429
Change-Id: I09b39682d907a1cd7ce140e0be0faaddfaba6bd1

core/java/android/preference/PreferenceActivity.java

index 7a41f3c..8f184b9 100644 (file)
@@ -1282,7 +1282,7 @@ public abstract class PreferenceActivity extends ListActivity implements
     }
 
     /**
-     * Start a new fragment containing a preference panel.  If the prefences
+     * Start a new fragment containing a preference panel.  If the preferences
      * are being displayed in multi-pane mode, the given fragment class will
      * be instantiated and placed in the appropriate pane.  If running in
      * single-pane mode, a new activity will be launched in which to show the
@@ -1305,10 +1305,6 @@ public abstract class PreferenceActivity extends ListActivity implements
         if (mSinglePane) {
             startWithFragment(fragmentClass, args, resultTo, resultRequestCode, titleRes, 0);
         } else {
-            if (!isValidFragment(fragmentClass)) {
-                throw new IllegalArgumentException("Invalid fragment for this activity: "
-                        + fragmentClass);
-            }
             Fragment f = Fragment.instantiate(this, fragmentClass, args);
             if (resultTo != null) {
                 f.setTargetFragment(resultTo, resultRequestCode);