安卓app中 activity与service通信问题

安卓app中 用什么方法能在activity中时刻监听service中通过binder传过来的数据啊!!
binder是实时传递数据吗

我是在service中设置了广播,在activity中设置广播接收器,这样就能监听接收到service的数据了

可以,在Activity绑定了一个Service,在onServiceConnected(ComponentName name, IBinder service) 回调方法中,返回了一个MsgService中的Binder对象,可以通过getService()方法来得到一个MsgService对象,然后可以调用MsgService中的一些方法

可以用 接口回调实现,或者也可以用 handler

同一进程随便传 intent eventbus等等,不同进程,广播,Binder,Messenger也可以,其实就是binder