当前位置:网站首页>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边栏推荐
猜你喜欢

2022焊工(初级)特种作业证考试题库及答案

【学习笔记】主成分分析法介绍

CSDN salary increase technology selenium automated test stack summary

Number theory -- detailed proof of Euler function, sieve method for Euler function, Euler theorem and Fermat theorem
![[graduation season · advanced technology Er] hard work can only pass, hard work can be excellent!](/img/e5/b6035abfa7d4bb59c3080d3b87ce45.jpg)
[graduation season · advanced technology Er] hard work can only pass, hard work can be excellent!

How to obtain the coordinates of the aircraft passing through both ends of the radar

Day88. qiniu cloud: upload house source pictures and user avatars

2022 welder (elementary) special operation certificate examination question bank and answers
oracle delete误删除表数据后如何恢复

Rsync remote synchronization
随机推荐
2. 整合 Filter
2022 t elevator repair test question bank simulation test platform operation
Resilience4j retry source code analysis and retry index collection
核芯物联蓝牙aoa定位系统服务器配置估算
[graduation season · advanced technology Er] hard work can only pass, hard work can be excellent!
Leetcode week 299
2022 tea master (intermediate) examination simulated 100 questions and simulated examination
The severity code indicates that the project file line prohibits the display of status errors. C1047 object or library file ".Lib" is different from other objects (such as "x64\release\main.obj")
SaaS sales upgrade under the new situation | tob Master Course
Visualization of neural network structure in different frames
数据资产为王,如何解析企业数字化转型与数据资产管理的关系?
Windows 64 bit download install my SQL
3. integrate listener
Xiaobai's e-commerce business is very important to choose the right mall system!
【学习笔记】聚类分析
2022 P cylinder filling test exercises and online simulation test
Pyinstaller打包pikepdf失败的问题排查
方 差 分 析
2342
怎么理解云原生数据库的易用性?