Open zhanghai opened 5 years ago
Apps may set their PreferenceScreen manually later so it's not safe to assume getPreferenceScreen() to return non-null in onViewCreated().
PreferenceScreen
getPreferenceScreen()
onViewCreated()
https://github.com/Gericop/Android-Support-Preference-V7-Fix/blob/32ee9c078aed2fa29b448cf608240cee7e6b4908/preferencex/src/main/java/com/takisoft/preferencex/PreferenceFragmentCompat.java#L102
Apps may set their
PreferenceScreen
manually later so it's not safe to assumegetPreferenceScreen()
to return non-null inonViewCreated()
.https://github.com/Gericop/Android-Support-Preference-V7-Fix/blob/32ee9c078aed2fa29b448cf608240cee7e6b4908/preferencex/src/main/java/com/takisoft/preferencex/PreferenceFragmentCompat.java#L102