对于一些上我的工作,对设备与API 19级我得到异常当android的isValidFragment()来自PreferenceActivity被调用?
Caused by: java.lang.RuntimeException: Subclasses of PreferenceActivity must override isValidFragment(String) to verify that the Fragment class is valid! com... has not checked if fragment com...$. is valid.
然后应用程序,我发现这些应用程序的Android框架protected boolean isValidFragment(String fragmentName)
获取调用,其代码
if (getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.KITKAT) {
throw new RuntimeException(
"Subclasses of PreferenceActivity must override isValidFragment(String)"
+ " to verify that the Fragment class is valid! " + this.getClass().getName()
+ " has not checked if fragment " + fragmentName + " is valid.");
} else {
return true;
}
然后我试图复制错误
我把我的示例应用程序的代码Preferences Activity Example 和添加的行清单中的。
但奇怪的是,我没有得到错误(isValidFragment()没有被调用的情况下)。
所以请告诉我如何在示例应用程序中复制该错误。
如果我写了一个应用程序,并在3年前出版,为什么不能让Google运行,而是设置此ANR – matheszabi