切换应用程序时如何更改此栏的颜色? [英] How do I change the color of this bar when switching apps?

查看:162
本文介绍了切换应用程序时如何更改此栏的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过添加Lollipop,您现在似乎可以在更改应用程序时更改此窗口的颜色.我不知道它叫什么名字,因此找不到任何信息,但是如果您查看图像,您会看到Keep应用程序现在变为黄色.

With the addition of Lollipop, it appears you can now change the color of this window when changing apps. I don't know what it is called and therefore can't find any info on it but if you look at the image you can see that the Keep app is now yellow.

如何更改这种颜色?

这里是图片的链接,因为我是新手,所以我不能附上它

谢谢

推荐答案

您可以使用setTaskDescription()来实现:

You can use setTaskDescription() to achieve this:

setTaskDescription(new ActivityManager.TaskDescription(label, icon, color));

对于android文档:

For android documentation:

设置描述此活动的任务的信息 最近用户系统界面中的演示文稿.当getRecentTasks(int, int)被调用,每个任务的活动按顺序遍历 从最顶部的活动到最底部的活动.遍历继续 对于每个属性,直到找到合适的值为止.对于每个任务 taskDescription将在ActivityManager.TaskDescription中返回.

Sets information describing the task with this activity for presentation inside the Recents System UI. When getRecentTasks(int, int) is called, the activities of each task are traversed in order from the topmost activity to the bottommost. The traversal continues for each property until a suitable value is found. For each task the taskDescription will be returned in ActivityManager.TaskDescription.

参数taskDescription 通过此活动描述任务

Parameters taskDescription The TaskDescription properties that describe the task with this activity

https://developer .android.com/reference/android/app/Activity.html#setTaskDescription(android.app.ActivityManager.TaskDescription)

这篇关于切换应用程序时如何更改此栏的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆