当前位置:网站首页>ANR无响应介绍
ANR无响应介绍
2022-06-28 20:19:00 【专业开发者】
1.1 概述
如果应用程序在一段时间内未做出响应或未结束执行,Android 系统会触发一个“应用程序无响应”(ANR) 对话框。一般来说,这种情况会在应用程序的 UI 线程因正在执行某项工作而无法按时处理输入事件时发生。具体来讲,检测到以下其中一种条件时会触发 ANR 对话框:
■ 应用程序未对键盘输入或触屏输入做出响应的时间长达 5 秒以上。
■ BroadcastReceiver 未在 10 秒内结束执行(后台广播则为 60 秒)。
■ Service 或 ContentProvider 的启动操作未在 20 秒内结束执行(后台服务则为 200 秒)。
有时,ANR 条件触发后并不显示对话框。这种情况通常是由于内部框架问题所致,例如在应用程序中发生 ANR 的同时,活动管理器或窗口管理器中存在死锁。这种情况最终会导致Android 看门狗超时。
1.1.1 Logcat ANR 消息
当应用程序中触发 ANR 时,会发出终止信号 (SIGABRT) 以结束无响应的应用程序。与此同时,logcat 的主缓冲区和系统缓冲区中会出现相应的消息。
在主 logcat 中,ANR 会显示一个针对应用程序的简单致命终止信号,如下所示:
Fatal signal 6 (SIGABRT) at 0x000002e5 (code=0), thread 29715 (com.android.settings)
更为详细的 ANR 消息可在系统 logcat 中查看。其中包含无响应应用程序的重要信息,包括应
用程序名称、ANR 原因、CPU 加载信息以及 IO 等待信息。
06-13 15:45:38.923 E/ActivityManager( 654):ANR in com.android.settings
(android/com.andro边栏推荐
- TcWind 模式设定
- Software supply chain security risk guide for enterprise digitalization and it executives
- Resilience4j retry source code analysis and retry index collection
- Leetcode week 299
- How to understand the usability of cloud native databases?
- 员工薪资管理系统
- Quaternion quaternion and Euler angle Transformation in Ros
- Head, tail view file
- 方 差 分 析
- Why does next() in iterator need to be forcibly converted?
猜你喜欢

ref属性,props配置,mixin混入,插件,scoped样式

Visualization of neural network structure in different frames
![[324. swing sequence II]](/img/4f/dbbc28c7c13ff94bd0956f2ccf9603.png)
[324. swing sequence II]

How strong a mathematical foundation does deep learning need?

Number theory -- detailed proof of Euler function, sieve method for Euler function, Euler theorem and Fermat theorem

Lecture 30 linear algebra Lecture 4 linear equations

2022 tea master (intermediate) examination simulated 100 questions and simulated examination

【算法篇】刷了两道大厂面试题,含泪 ”重学数组“

2022年T电梯修理考试题库模拟考试平台操作

Bluecmsv1.6 code audit
随机推荐
2022 P cylinder filling test exercises and online simulation test
ROS中quaternion四元數和歐拉角轉換
ArrayList of collection
Employee salary management system
Severity code description project file line suppress status error lnk2038 detected a mismatch of "runtimelibrary": the value "md\u dynamicrelease" does not match the value "mdd\u dynamicde"
Are you still paying for your thesis? Come and join me
Server configuration estimation of core IOT Bluetooth AOA positioning system
员工薪资管理系统
internship:术语了解及着手写接口
Real number operation
[learning notes] factor analysis
2342
怎么理解云原生数据库的快速迭代?
Average score of 100 people
修复一次flutter 无法选中模拟器
Keyword long
risc-v指令集
bluecmsv1.6代码审计
Quaternion quaternion and Euler angle transformation in ROS
Win 10 create a gin framework project