Override the include's background attribute to change background color

this does not seem to be possible. You can set background from java.

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white">

    <include
        android:id="@+id/layout1"
        layout="@layout/chat_profile_header"/>

    <include
        android:id="@+id/layout2"
        layout="@layout/chat_profile_header"/>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rvParentList"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    </android.support.v7.widget.RecyclerView>
</LinearLayout>

this java code

Linealayout layout1 = (Linealayout)findViewbyId(R.id.layout1);
Linealayout layout2 = (Linealayout)findViewbyId(R.id.layout2);

layout1.setBackgroundColor(R.color.color_1);
layout2.setBackgroundColor(R.color.color_2);

You can always change your background color with layout theme you specified. Just set the

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/colorPrimary">
</LinearLayout>

Then set the colorPrimary under your theme style files. Warning: by setting the color primary, you are changing the color of the action bar as well.

<style name="MyCustomTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@android:color/blue</item>
</style>

Using this method, your background will always be the same as the color you specified under the theme style. Just in case, you doesn't know how to set the theme for you activity, you can always do in your AndroidManifest.xml

<activity
        android:name=".Activity"
        android:theme="@style/MyCustomTheme"
/>

You can not set background color to <include> tag.

As you set the background color of include tag then it will be messed up with the include layout's background color.

So from my point of view you should make your include layout transparent and then try to set background color of it.

In this case it won't get mixed up with the include layout's color.

Hope it will help you to get some idea regarding it.