Service
来源:互联网 发布:nginx pathinfo配置 编辑:程序博客网 时间:2024/06/02 12:32
1. Service被设计成长期运行的组件,相反生命周期短并且随时被停止运行的组件包括Activities, content providers, 和 intent receivers。
Activities, content providers, and intent receivers are all short-lived and can be shut down at any time. Services, on the other hand, are designed to keep running, if needed, independent of any activity.
2.应用的场合
You might use a service for checking for updates to an RSS feed, or to play back music even if the controlling activity is no longer operating.playing music even if the "player" activity gets garbage-collected, polling the Internet for RSS/Atom feed updates, and maintaining an online chat connection even if the chat client loses focus due to an incoming phone call.
3.IPC inter-process communication
4.注意的问题
Service可能会长期占用系统资源,会引发电池不足的现象。
5.创建Service
(1)定义子类继承Service
(2)重写onCreate()/onStart()/onDestroy()...
- Service
- Service
- service
- Service
- service
- Service
- Service
- service
- Service
- Service
- Service
- service
- service
- Service
- Service
- Service
- Service
- Service
- struts2从表单取值的三种方式
- 如何做好优秀的UI设计
- SUSE下telnet的简单配法,转贴 -- 记录一下,以便备份
- ubuntu 网易源
- 到CSDN 安家了!!!!!!!欢迎来我的小屋看看
- Service
- 请不要做浮躁的人——转给即将上路或者正在路上的程序员朋友
- Core_Dump for Linux and Windows
- win7 下 打开 telnet 功能
- 技术人员个人职业规划发展六大方向导航
- 三层架构(3-tier application) 与MVC对比
- TestLink各项异常处理
- Linux下集群服务器文件共享的解决方案
- System.Runtime.InteropServices.COMException (0x8000401A): Retrieving the COM class factory for component with CLSID