1 异常描述:
Caused by: java.lang.RuntimeException: Subclasses of PreferenceActivity must override isValidFragment(String) to verify that the Fragment class is valid! com.eric.windows.event.MyPreferenceActivity has not checked if fragment com.eric.windows.event.MyPreferenceFragment is valid.
2 原因
SDK19以上的安全限制,需要重写isValidFragment。
3 解决方案:
重写isValidFragment,返回true,如:
@Override
protected boolean isValidFragment(String fragmentName) {
return true;
}