Service
来源:互联网 发布:ubuntu 编辑:程序博客网 时间:2024/04/30 08:10
service能被启动with Context.startService() and Context.bindService().
像其他的APP对象,他也执行在主线程中。这意味着开新线程对于耗CPU的
onCreate() onstart后,SERVICE将停在在这里直到 Context.stopService() or stopSelf() is called
无论掉多少次 Context.startService().如果SERVICE已经启动,那么只有ONSTART接受调用。而且停止只会有一次通过.stopService() or stopSelf()
Context.bindService() 也可以得到SERVICE,如果没有创建,这个SERVICE将调用ONCREATE,但是不将调用ONSTART
Process Lifecycle
如果SERVICE已经被启动,他的进程将比可视进程差点,但是比不可视的重要
如果一个客户绑定到了这个SERVICE,那么这个SERVICE的进程至少和客户同等重要,
也就是说,如果客户是可视的,这个SERVICE自己也被考虑为可视的。
A started service can use the startForeground(int, Notification) API to put the service in a foreground state
- Service
- Service
- service
- Service
- service
- Service
- Service
- service
- Service
- Service
- Service
- service
- service
- Service
- Service
- Service
- Service
- Service
- Module间的通讯
- VS2008与WDK 环境配置
- 超链接颜色
- warning LNK4221: 未找到公共符号;存档成员将不可访问
- vc 每次都重新编译的原因
- Service
- Struts2 execAndWait拦截器的使用
- 在grub 1.97中加载系统中所有硬盘中的所有操作系统–更新grub.cfg
- 服务器推送技术
- spring实例化bean的方式
- 利用flash与.net下socket通信实现WEB页面的“推”
- ABAP高级顾问应该掌握的技术
- 让环境变量生效不需重启Windows
- asp.net性能优化的几个方面