今天在练习磁场传感器(M-sensor),在最后用AVD运行时候程序闪退,但build没有任何问题,也没有报错。然后查了下logcat,发现报错:java.lang.IllegalStateExceptio:Underflow in restore - more restores than saves意思是恢复的比保存的多,如下图:

问题出在canvas.restore()上,想着用try-catch捕捉一下,结果运行发现不会出现闪退 ,且运行正常。

在运行时捕获异常java.lang.IllegalStateExceptio:Underflow in restore - more restores than saves,不会影响运行。

哦耶✌✌✌

解决:java.lang.IllegalStateExceptio:Underflow in restore - more restores than saves异常,Module闪退相关推荐

  1. java.lang.IllegalStateException: Underflow in restore - more restores than saves

    1. 错误描述 java.lang.IllegalStateException: Underflow in restore - more restores than saves 2. 错误原因 Can ...

  2. Android java.lang.IllegalStateException: Underflow in restore - more restores than saves

    原因:在自定义view里面调用了 c.restore(); 方法来保存画布的bitmap图像: 解决: c.save();//在之前先写这一句 c.restore();

  3. Java java.lang.ArithmeticException: Underflow问题解决

    问题描述: java.lang.ArithmeticException: Underflow 问题分析: 1.使用BigDecimal.setScale(int newScale)方法时,newSca ...

  4. jsp项目中连接数据库解决java.lang.ClassNotFoundException: com.mysql.jdbc.Driver的问题

    jsp项目中连接数据库解决java.lang.ClassNotFoundException: com.mysql.jdbc.Driver的问题 参考文章: (1)jsp项目中连接数据库解决java.l ...

  5. 解决”java.lang.UnsatisfiedLinkError: Native Library .dll already loaded in another classloader”的问题

    解决"java.lang.UnsatisfiedLinkError: Native Library .dll already loaded in another classloader&qu ...

  6. 解决java.lang.OutOfMemoryError: unable to create new native thread问题

    解决java.lang.OutOfMemoryError: unable to create new native thread问题 参考文章: (1)解决java.lang.OutOfMemoryE ...

  7. 已解决java.lang.Integer cannot be cast to java.lang.String异常的正确解决方法,亲测有效!!!

    已解决java.lang.Integer cannot be cast to java.lang.String异常的正确解决方法,亲测有效!!! 文章目录 报错问题 解决方法 福利 报错问题 1.在执 ...

  8. 解决 java.lang.RuntimeException: Method i in android.util.Log not mocked. See http://g.co/androidstudi

    解决 java.lang.RuntimeException: Method i in android.util.Log not mocked. See http://g.co/androidstudi ...

  9. 解决“java.lang.OutOfMemoryError: Failed to allocate a allocation until OOM”错误

    1.参考:解决"java.lang.OutOfMemoryError: Failed to allocate a allocation until OOM"错误_SEVENY_的博 ...

最新文章

  1. CSS3 transform
  2. TrojanDownloader简单分析
  3. 给初级拍摄者的十条好建议
  4. Mysql Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
  5. 计算机网络的非性能特征PPT,计算机网络概述课件课件.ppt
  6. word图片嵌入式为何只能看到一部分_如何巧妙选择打印Word文档内容?
  7. 计算机用三角函数时如何用弧度制,单元备课三角函数
  8. PHPUnit的使用
  9. Nginx从入门到入坟(十)- Rewrite功能详解与案例实操
  10. ps怎么将png做成gif_用ps将一组图片序列做成GIF
  11. (2)VBA 关键字
  12. nyoj1273 河南省第九届省赛_宣传墙、状压DP+矩阵幂加速
  13. 【Midjourney教程】设计麻瓜也能10分钟上架一套表情包
  14. dd_engi的背包九讲(新版转载)
  15. 视频教程-Bootstrap3从基础到案例实战,完美实现响应式网站案例-Bootstrap
  16. 成功解决matplotlib.units.ConversionError: Failed to convert value(s) to axis units: ‘LiR‘
  17. 谷歌人工智能责任:技术、人工智能、社会和文化 | Responsible AI at Google Research: Technology, AI, Society and Culture
  18. 贝叶斯条件概率/贝叶斯网络
  19. Apache服务器的启动方法
  20. 办公自动化确实提高了单位的运行效率

热门文章

  1. This Python interpreter is in a conda environment, but the environment hasnot been activated. 如何解决?
  2. uniapp开发小程序,引入腾讯兔小巢插件,兔小巢页面导航头部样式错乱问题
  3. 卷积神经网络流程图_AAAI 2020 | 北大:图卷积中的多阶段自监督学习算法
  4. 基于 Spring SSM框架 开发的一套 进存销管理系统
  5. elementUI——form表单
  6. powershell课后作业
  7. 【渝粤题库】陕西师范大学203041 行政法与行政诉讼法学作业
  8. 近代自然科学为啥未诞生在中国----中国文化的欠缺
  9. vue-element之学生信息表格(详细代码)
  10. prescan8.5 百度网盘下载链接及安装过程