答案 0 :(得分:2)
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), app_icon);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bitmap , getResources().getColor(R.color.your_color));
MainActivity.setTaskDescription(taskDesc);
答案 1 :(得分:2)
非常简单,转到res/values/colors.xml
文件,然后将colorPrimary
更改为所需的颜色:
<color name="colorPrimary">YOUR_REQUIRED_COLOR_HERE</color>
如果您需要JAVA
,也可以使用@mohammadRezaAbiri给出的答案:
Bitmap bm = BitmapFactory.decodeResource(getResources(), app_icon);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.primary_600));
MainActivity.setTaskDescription(taskDesc);