How to fix warning log
tcqq opened this issue · 1 comments
tcqq commented
Code:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
int layoutId = getLayoutId();
if (layoutId != defaultLayoutId) {
binding = DataBindingUtil.inflate(inflater, layoutId, container, false);
return binding.getRoot();
}
try {
return super.onCreateView(inflater, container, savedInstanceState);
} finally {
// Change the divider default style
setDividerPreferences(DIVIDER_CATEGORY_BEFORE_FIRST | DIVIDER_CATEGORY_BETWEEN | DIVIDER_NO_BEFORE_FIRST);
}
}
Error log:
W/PreferenceFragmentFix: Warning: setDividerPreferences(flags) was called before the list was constructed. Please, move the method to onCreateView(...) after the super.onCreateView(...) call!
gregkorossy commented
This is no longer relevant. The 28.0.0 version deprecates the PreferenceFragmentCompatDividers
, and the AndroidX version removes it completely.