BroadcastReceivers的重要特性
来源:互联网 发布:wifi软件哪个好用 知乎 编辑:程序博客网 时间:2024/06/03 19:13
1. A broadcast receiver, like other components of an An droid process,
runs on the main thread.
2. Holding up the code in a broadcast receiver will hold up the main
thread and will result in ANR.
3.The time limit on a broadcast receiver is ten seconds compared to five
seconds for an activity. It is a touch of a reprieve, but the limit is still
there.
4. The process hosting the broadcast receiver will start and terminate
along with the broadcast receiver execution. Hence the process will
not stick around after the broadcast receiver’s onReceive() method
returns. Of course, this is assumi ng that the process contains only the
broadcast receiver. If the process contains other components, such as
activities or services, that are alr eady running, then the lifetime of the
process takes these component life cycles into account as well.
5. Unlike a service process, a broadcast receiver process will not get restarted.
If a broadcast receiver were to start a separate thread and return to
the main thread, Android will assume that the work is complete and
will shut down the process even if there are threads running, bringing
those threads to abrupt stop.
6. Android acquires a partial wake lock when invoking a broadcast
service and releases it when it re turns from the service in the main
thread. A wake lock is a mechanism and an API class available in the
SDK to keep the device from going to sleep or wake it up if it is
already asleep.
- BroadcastReceivers的重要特性
- 算法的五个重要特性
- MySQL 一些重要的特性:
- ReactJS的七个重要特性
- HTML5的重要新特性
- C++的重要特性-模板
- C++的重要特性-模板
- 多线程程序的一些重要特性
- 论述HTML5平台的若干重要特性
- GitLab 6.4的重要新特性
- java JDK1.5的重要特性
- Winform开发框架的重要特性总结
- C++ 11 的一些重要新特性
- 几个重要的概率分布及其特性
- 网络舆情安全体系的重要特性
- IBatis 其他重要特性
- JS重要特性参考
- JDK5中的重要特性
- 取石子游戏之尼姆博弈
- JAVA中的abstract的介绍
- 使用systemtap修改kernel参数
- 策略枚举模式
- iOS学习--从lazyTableImages官方例子学到的一些东西
- BroadcastReceivers的重要特性
- struts2 sample
- javascript中变量的判断
- Qt开发视频软件
- linux命令行下联网
- 基于大规模语料的新词发现算法
- 搭建Android开发环境
- HDOJ 2602 Bone Collector
- 为多态基类声明virtual析构函数