android - 安卓中服务与组件通信的问题
PHPz
PHPz 2017-04-17 17:53:47
0
1
459

菜鸟求教:一直很疑惑一个问题,如果活动想要跟组件通信时,为什么不能

intent = new Intent(...);
startService(...);

启动服务后,然后直接调用service类中的方法?为什么一定要将活动和服务绑定(这样不是还得实现ServiceConnection类并且还要修改service类中的onBinder()方法么)
感谢您的指点迷津~

PHPz
PHPz

学习是最好的投资!

reply all(1)
洪涛

Activity passes bindService to solve the problem of calling activiy and service when they are not in the same process. If it is the same process, you can directly call the method in service!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template