admin管理员组

文章数量:1642471

1. 发送广播/接收广播出现ANR

如: 

01-01 18:53:21.392 W/BroadcastQueue( 2589): Timeout of broadcast BroadcastRecord{18162c1 u-1 android.intent.action.XXX_XX} - receiver=android.os.BinderProxy@5656678, started 10002ms ago
01-01 18:53:21.392 W/BroadcastQueue( 2589): Receiver during timeout of BroadcastRecord{18162c1 u-1 android.intent.action.XXX_XX} : BroadcastFilter{de5b897 10081/u0 ReceiverList{8e457e6 22351 com.android.aaa/10081/u0 remote:5656678}}
01-01 18:53:21.993 W/BroadcastQueue( 2589): Skipping deliver [foreground] BroadcastRecord{18162c1 u-1 android.intent.action.XXX_XX} to ReceiverList{d139c53 7589 com.android.xxx2//11312/u0 remote:c867686}: process gone or crashing

出现了发出广播10s了,但是Receiver没有及时响应(ANR), 则有可能在

(1)  com.android.aaa onReceive 方法中,做了一些耗时操作,或者这个应用占用资源过多, 导致无法及时在onReceive() 方法中结束并返回

这个时候,onReceive 应该做一些简单的操作,例如启动一个Service 处理,然后返回。

(2) 系统正在忙(CPU),例如Binder 挂掉了

(3) 应用内存泄漏了

参考:

https://stackoverflow/questions/6535664/timeout-of-broadcast-broadcastrecord

https://stackoverflow/questions/8962600/whats-the-error-in-my-logcat

本文标签: 常见问题组件android