StupidBeauty
Read times:1257Posted at: - no title specified

转载 android Service 总结

Service的onStart方法已经过期,不建议使用,现在应当使用onStartCommand方法。

http://www.cnblogs.com/byghui/archive/2013/05/14/3076398.html

亮点:

onStart(Intent intent, int startId) 已被标注 Deprecated, onStartCommand 方法取代,其实 onStartCommand 在内部也是调用 onStart ,只是多了个 int 返回值。

int onStartCommand(Intent intent, int flags, int startId): 该方法的早期版本是 onStart(Intent intent, int startId), 每当客户端调用 startService(Intent) 时系统将        回调此方法。其有一个 int 返回值,系统根据此值决定当系统由于某种原因 ( 比如:内存紧张 ) 销毁此 service 后,是否重启它及对 intent 的处理细节。

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands