Q:

Divider lines are not correct on Android 5 and Android 4 phones

In my android application, I am migrating my app to "com.android.support:preference-v14:23.4.0" for my settings screen. I am using Theme.appCompat theme. Everything works fine on Android 6 phones. 
But on Android 5 and Android 4 phones, I noticed that the divider lines are "black" in color. As I used dark theme, so they should be white (with some alpha). it is the case for Android 6 phones, but not for Android 5 and Android 4.
I tried a lot to change divider color but unable to do so. I also loooked for solutions on internet but nothin seem to work. Can someone help me with this

A:

you can use the setDivider Method provided by PreferenceFragmentCompat class. That will change the style of your divider. 
But to use that method you need to be sure the view is created otherwise you will get a nullPointer error.
The best place to do that is to change the style in onViewCreated.
Example:
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    setDividerStyle();
}

private void setDividerStyle() {
    ColorDrawable test  = new ColorDrawable(getActivity().getResources().getColor(R.color.your color));
    setDivider(test);
    setDividerHeight(1);
}

