Example: Communication between Activity and Service using Messaging

前端 未结 9 852
既然无缘
既然无缘 2020-11-22 00:06

I couldn\'t find any examples of how to send messages between an activity and a service, and I have spent far too many hours figuring this out. Here is an example project fo

9条回答
  •  日久生厌
    2020-11-22 00:48

    Everything is fine.Good example of activity/service communication using Messenger.

    One comment : the method MyService.isRunning() is not required.. bindService() can be done any number of times. no harm in that.

    If MyService is running in a different process then the static function MyService.isRunning() will always return false. So there is no need of this function.

提交回复
热议问题