Service(服務)知識要點

1.Service的生命週期? Service的啓動有兩種方式,先來看主要的一種 1.通過startService()方法啓動服務,如果服務之前沒有創建過,先調用onCreate()方法,之後調用onStartCommand()方法,使用stopService()方法停止服務之後,回調onDestory()方法 2.通過bindService()啓動服務,沒有創建的話也是先調用onCreate()
相關文章
相關標籤/搜索