How to establish a two-way communication between Activity and Service in different process?

前端 未结 3 2047
野趣味
野趣味 2020-12-14 13:02

I\'m working on establishing a two-way communication between an Activity and a Service which runs in a different process.

Querying the process from the Activity is n

3条回答
  •  感动是毒
    2020-12-14 13:27

    Either use BroadcastReceiver or have the Activity register a callback or listener object that the Service calls on key events. The links above are to book example projects demonstrating each of those techniques.

提交回复
热议问题