菜鸟求教:一直很疑惑一个问题,如果活动想要跟组件通信时,为什么不能
intent = new Intent(...); startService(...);
启动服务后,然后直接调用service类中的方法?为什么一定要将活动和服务绑定(这样不是还得实现ServiceConnection类并且还要修改service类中的onBinder()方法么)感谢您的指点迷津~
学习是最好的投资!
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!
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!