Service之onStartCommand()
public int onStartCommand (Intent intent, int flags, int startId)当其它组件,比如一个activity,通过调用startService()请求started方式的服务时,系统将会调用本方法。 一旦本方法执行,服务就被启动,并在后台一直运行下去。 如果你的代码实现了本方法,你就有责任在完成工作后通过调用stopSelf()或stopSe
原创
2015-12-24 16:00:38 ·
274 阅读 ·
0 评论