How to get data from service to activity

后端 未结 4 1919
-上瘾入骨i
-上瘾入骨i 2020-11-27 04:11

In my app I have an activity and a service... The service will broadcast messages gathered from data from GPS... The Activity should receive the broadcast messages and updat

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 04:42

    There are three obvious ways to communicate with services

    1. Using Intents.
    2. Using AIDL.
    3. Using the service object itself (as singleton).

提交回复
热议问题