生命周期:onCreate()->onStartCommand()->Service running->onDestroy()
生命周期:onCreate()->onBind()->Clients are bound to service->onUnbind()->onDestroy()
(1)startServic:調用onCreate()->onStartCommand()
(2)stopService:調用onDestory()
(1)bindservice:調用onCreate()->onBind()
(2)unbindService:調用onUnbind()->onDestroy()
(1)startServic:調用onCreate()->onStartCommand()
(2)bindService:調用onBind()
(3)stopService:沒有調用onDestory() Service仍然在運行!
(4)unbindService:調用onUnbind()->onDestory() 此時Service關閉!
(1)startServic:調用onCreate()->onStartCommand()
(2)bindService:調用onBind()
(3)unbindService:調用onUnbind() Service仍然在運行!
(4)stopService:調用onDestory() 此時Service才關閉!