服务的两种启动方式
2020-07-31 11:39:58 3 举报
登录查看完整内容
Android中服务启动的两种方式:startService()、bindService()
作者其他创作
大纲/内容
unbindService()
onStartCommand()
onBind()
onDestroy()
准备结束服务
通过bindService()方式启动服务,访问者与服务绑定在一起,访问者一旦退出,服务也终止
startService()
onCreate()
onBind(Intent intent)
onRebind()
onUnbind()
bindService()
通过startService()运行的服务,访问者和服务没有关联,访问者退出,服务仍继续运行
stopService()
服务运行中
0 条评论
回复 删除
下一页