I just created a PreferenceActivity using the AndroidStudio wizard, running it, there was a strange exception:
java.lang.RuntimeException: Subclasses of PreferenceActivity must override isValidFragment(String) to verify that the Fragment class is valid!
I saw the suggested solutions here , but I was wondering why I should check if my fragment classes are really valid, because I donβt even fully understand what the definition of "valid" means, so I decided to ask the community:
a The preference method has the isValidFragment(String fragmentName) method, which for some reason needs to be reevaluated, why? how is the fragment class invalid? and what could go wrong with such an override:
@Override protected boolean isValidFragment(String fragmentName) { return true; }
android android-fragments
Ofek Ron Sep 25 '15 at 10:46 2015-09-25 10:46
source share