PreferenceActivity之 Subclasses of PreferenceActivity must override isValidFragment(String)
生活随笔
收集整理的這篇文章主要介紹了
PreferenceActivity之 Subclasses of PreferenceActivity must override isValidFragment(String)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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;
}
@Override
protected boolean isValidFragment(String fragmentName) {
return true;
}
總結
以上是生活随笔為你收集整理的PreferenceActivity之 Subclasses of PreferenceActivity must override isValidFragment(String)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [vue] 跟keep-alive有关的
- 下一篇: [css] 你对伪类了解多少?分为几大