5.1 Crash - a Taskdescription's Primary Color Should Be Opaque

5.1 Crash - A TaskDescription's primary color should be opaque

You can not use alfa in primary color. The primary color has to be opaque.

Change:

<item name="colorPrimaryDark">#4DFF9800</item>
<item name="colorPrimary">#4D607D8B</item>

To

<item name="colorPrimaryDark">#FF9800</item>
<item name="colorPrimary">#607D8B</item>

for api 21 in res/values-v21/style.xml file

A TaskDescription's primary color should be opaque Android 6.0

The reason is that TaskDescription("AppName", bm ,R.color.colorPrimaryDark) needs colour value as parameter and you're using resource id. It is not the same, you have to get your colour via method context.getResources().getColor(R.color.colorPrimaryDark).

Change :

ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription("AppName", bm ,R.color.colorPrimaryDark);

to

ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription("AppName", bm , ContextCompat.getColor(context, R.color.colorPrimaryDark));

How to Change ListView Font Color?

Actually, you cannot change font color of ListView, because ListView does not have text in it. Instead, you can change the items in ListView which is normally provided using an BaseAdapter.

For more about ListView, check out the Hello ListView tutorial. Also, you can check out this ListView example which contains a customized BaseAdapter in ApiDemos. This might solve your problem.



Related Topics



Leave a reply



Submit