How to change the color of an app's Title Bar in the Android app switcher?

I’m currently developing an application which has a red logo and uses red as the main color throughout all the menus. However, in the android 5.0 app switch screen, the app is displayed with a blue title bar (I believe the technical term is “Action Bar”), which looks seriously ugly. I have found this on google’s site:

but I don’t know where to put the xml they show, since the only overridable android file I know of is the AndroidManifest. Any help would be greatly appreciated.

In my search, I came up on something called ActivityManager.TaskDescription which was added in Android 5: ActivityManager.TaskDescription

This can be used in Java to set the appearance of the task in the app switcher (“Recents UI” as Google calls it, but we all know it’s an app switcher) like this:

Bitmap Icon = BitmapFactory.decodeResource(getResources(), getApplicationInfo().icon); // Needed by TaskDescription, doesn't change anything
ActivityManager.TaskDescription T = new TaskDescription("Title", Icon, Color.argb(255, 255, 255, 255)); // <-- The color argument is what I needed to set
setTaskDescription(T);

Or, translated to Unity’s JNI interface in C#:

try //The TaskDescription API is unavailable on Android 4.4 and below
{
    var ActivityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
    var Activity = ActivityClass.GetStatic<AndroidJavaObject>("currentActivity");
    var Resources = Activity.Call<AndroidJavaObject>("getResources");
    var AppInfo = Activity.Call<AndroidJavaObject>("getApplicationInfo");
    int IconResId = AppInfo.Get<int>("icon");
    var BitmapFactoryClass = new AndroidJavaClass("android.graphics.BitmapFactory");
    var Icon = BitmapFactoryClass.CallStatic<AndroidJavaObject>("decodeResource", Resources, IconResId);
    var ColorClass = new AndroidJavaClass("android.graphics.Color");
    var _Color = ColorClass.CallStatic<int>("argb", (int)Color.a, (int)Color.r, (int)Color.g, (int)Color.b);
    var TaskDescription = new AndroidJavaObject("android.app.ActivityManager$TaskDescription", Application.productName, Icon, _Color);
    Activity.Call("setTaskDescription", TaskDescription);
}
catch { }

Which can be used to set the Title Bar’s color as and when needed.

Haven’t done this for Unity projects but in general you have to define the style for the bar in a resource XML res/values/themes.xml (like the page says) and then modify the XML that defines the main Unity Activity to use that style. I don’t think this can be set up in Unity so you have to build the game as an Android project (instead of straight to APK) and make the modifications in there