?
1、startService
当调用startService()时,Service的声明周期如下:
onCreate
onStartCommand
onStart
当调用stopService()时,
onDestroy
当调用Service的Activity销毁后,并Service并没有destroy,仍然在运行
2、bindService
? ? 调用bindButton()时,Service的声明周期如下:
onCreate
onBind
调用unbindService时,
onUnbind
onDestroy
当调用bind Service的Activity时候,Service也销毁了,调用
onUnbind
onDestroy