我们从生命周期来看:
startService启动service会走=>onCreate和onStartCommand
bindService启动service会走=>onCreate和onBind方法,并且通过bindService启动的service会与activity共存亡,当activity销毁的时候service也会随之销毁
我们从生命周期来看:
startService启动service会走=>onCreate和onStartCommand
bindService启动service会走=>onCreate和onBind方法,并且通过bindService启动的service会与activity共存亡,当activity销毁的时候service也会随之销毁