Android Intent调用打开Service

柔光的暖阳◎ 2023-06-19 02:18 106阅读 0赞

1,StartService

【1】打开服务

Intent it=new Intent(this, SimpleService.class);

startService(it);

【2】关闭服务

stopService(it);

2,bindService

【1】绑定服务

Intent intent = new Intent(this, LocalService.class);

bindService(intent, conn, Service.BIND_AUTO_CREATE);

【2】解绑服务

unbindService(conn);

更多Intent 使用详解:https://blog.csdn.net/cricket_7/category_9549721.html

发表评论

表情:
评论列表 (有 0 条评论,106人围观)

还没有评论,来说两句吧...

相关阅读