Service的两种启动方式

一、Context.startService()
* 声明周期:
Service中Context中
----------------------------------------------------------------------------------------
onCreate()<----startService()
onStartCommand()
onDestory()<----stopService() / Service#stopSelf()


二、Context.bindService()
【Service的两种启动方式】* 声明周期:

Service中Context中
----------------------------------------------------------------------------------------
onCreate()<----bindService()
onBind()
onUnbind()<----unBindService()
onDestory()

    推荐阅读