• 报错描述:
  • 原因分析:
  • 解决方案:

报错描述:

java.lang.RuntimeException: A TaskDescription's primary color should be opaque

原因分析:

这错误是由于styles.xml文件的主题颜色代码里设置了alpha透明值导致的。

/*** Creates the TaskDescription to the specified values.** @param label A label and description of the current state of this task.* @param icon An icon that represents the current state of this task.* @param colorPrimary A color to override the theme's primary color. This color must be opaque.*/public TaskDescription(String label, Bitmap icon, int colorPrimary) {if ((colorPrimary != 0) && (Color.alpha(colorPrimary) != 255)) {throw new RuntimeException("A TaskDescription's primary color should be opaque");}mLabel = label;mIcon = icon;mColorPrimary = colorPrimary;}

解决方案:

将alpha值去除即可,如果想要设为全透明用 #00000000 即可。

java.lang.RuntimeException: A TaskDescription‘s primary color should be opaque相关推荐

  1. Java.lang.RuntimeException: Unable to start activity

    异常信息 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lwm.myapplication/com.lw ...

  2. 记录错误:java.lang.RuntimeException: Unable to start activity ComponentInfo

    android  activity打不开,具体错误如下: 01-02 00:02:25.495 E/AndroidRuntime(  984): FATAL EXCEPTION: main 01-02 ...

  3. java.lang.RuntimeException: Expected one of local, maven-local, maven-central, scala-tools-releases,

    java.lang.RuntimeException: Expected one of local, maven-local, maven-central, scala-tools-releases, ...

  4. java.lang.RuntimeException: Canvas: trying to draw too large(203212800bytes) bitmap.

    java.lang.RuntimeException: Canvas: trying to draw too large(203212800bytes) bitmap. 异常原因分析:Canvas绘制 ...

  5. 解决 Android java.lang.RuntimeException: Stub!

    错误堆栈: java.lang.RuntimeException: Stub!at org.apache.http.message.AbstractHttpMessage.<init>(S ...

  6. java.lang.RuntimeException: Handler (com.***.behavior.BEvent$1) {421bca80} sending message to a Hand

    java.lang.RuntimeException: Handler (com.***.behavior.BEvent$1) {421bca80} sending message to a Hand ...

  7. java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

    java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() ...

  8. java.lang.RuntimeException: setParameters failed

    java.lang.RuntimeException: setParameters failed 解决方法:只能设置系统能支持的宽高参数. Camera.Parameters param = mCam ...

  9. 我的Android进阶之旅------gt;Android中MediaRecorder.stop()报错 java.lang.RuntimeException: stop failed....

    今天在调用MediaRecorder.stop(),报错了,java.lang.RuntimeException: stop failed. E/AndroidRuntime(7698): Cause ...

最新文章

  1. HDFS之SequenceFile和MapFile
  2. Lua中的模块与module函数详解
  3. OpenGL和图形卡
  4. Mysql数据库“Communications link failure due to underlying exception”问题
  5. 接触Jenkins(Hudson)API,第2部分
  6. 【CSU - 1980 】不堪重负的树(树上区间dp)
  7. Objective-C之MRC、ARC模式下,属性修饰关键字strong、retain、assign、weak的区别和联系...
  8. 吴恩达《机器学习》学习笔记五——逻辑回归
  9. css 轨道,html-当其他轨道增加时,CSS网格的轨道不会缩...
  10. 数据安全对企业的重要性
  11. 【loj3056】【hnoi2019】多边形
  12. delphi 软件在线人数统计_【大学分析】计算机爆满,软件爆冷!这所985大学考研分数截然不同!...
  13. NET常出现的三十三种代码(1)
  14. html中字体 楷体_(收藏)css怎么设置字体为楷体?
  15. CCF CSP 202104-1
  16. linux startx无效_LINUX startx命令-用来启动X Window
  17. 文件排版2.2 (python)
  18. Akka(6): become/unbecome:运算行为切换
  19. 多目标优化中常用的绩效指标(Performance Indicator)(最全概括)
  20. 在STM8(STVP编译环境下)中使用位变量

热门文章

  1. ubuntu20.04安装mysql8
  2. FileZilla软件安装教程
  3. SpringCloud SpringBoot b2b2c 微服务 多商家入驻直播商城之Git 远程仓库(Github)
  4. RuntimeError: iter() is only supported inside of tf.function or when eager execution is enabled.
  5. 【计算机组成原理】IEEE 754
  6. 定时器alarm函数
  7. SecureCRT 多个会话显示在同一窗口
  8. 老罗锤子手机(Smartisan T1)的一些感想
  9. 红外和可见光图像融合算法研究
  10. 康福中国服务器位置,康福中国camfrog服务器管理命令有哪些?