search

Home  >  Q&A  >  body text

android - service和activity之间的通讯

service和activity之间除了基本的binder回调、广播机制之外,还有没有其他的一些通讯方式?

高洛峰高洛峰2772 days ago443

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-17 17:37:55

    In fact, there are not many cross-process communications in Android. In addition to the binder and broadcast mentioned by the blogger, there is another type of communication that is commonly used at the bottom level, which is socket communication.
    In fact, if it spreads, there can also be communication based on contentprovider. Because the content provider can set up a listener, communication can be achieved through monitoring at this time. Of course, this is a side story. The best way is binder and broadcast. When using broadcast as an inter-process communication, you should pay attention to setting the corresponding permissions.

    reply
    0
  • Cancelreply