We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BroadcastReceiver 在 registerReceiver 时可以指定 handler,用于指定 onReceive 执行的线程,如果不设置 handler 的话默认是主线程,因此正常情况下 onReceive 确实是在主线程执行。当指定了非主线程来作为 onReceive 的执行线程,在这个线程如果 block 超过 timeout 时间的话,也会触发 ANR,这个经过实验验证过。BroadcastReceiver 相较其他三大组件比较特殊,可以指定执行线程,其他三大组件目前了解下来没有相关的方法,因此个人认为如果作为进阶读物的话,anr 这里关于 BroadcastReceiver 可能需要单独列一下比较好,避免有歧义。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
BroadcastReceiver 在 registerReceiver 时可以指定 handler,用于指定 onReceive 执行的线程,如果不设置 handler 的话默认是主线程,因此正常情况下 onReceive 确实是在主线程执行。当指定了非主线程来作为 onReceive 的执行线程,在这个线程如果 block 超过 timeout 时间的话,也会触发 ANR,这个经过实验验证过。BroadcastReceiver 相较其他三大组件比较特殊,可以指定执行线程,其他三大组件目前了解下来没有相关的方法,因此个人认为如果作为进阶读物的话,anr 这里关于 BroadcastReceiver 可能需要单独列一下比较好,避免有歧义。
The text was updated successfully, but these errors were encountered: