how does a service return result to an activity

后端 未结 4 467
有刺的猬
有刺的猬 2020-12-24 12:25

I seem to have a classic task, yet I can\'t find any examples on how to do it.

I want to download something. Well I call a web service and get a response... but it\'

4条回答
  •  温柔的废话
    2020-12-24 13:05

    Send a broadcast Intent with the data via sendBroadcast(), that the activity picks up with a BroadcastReceiver.

    Here's an example of that: https://github.com/commonsguy/cw-android/tree/master/Service/WeatherAPI Doc: http://developer.android.com/reference/android/content/BroadcastReceiver.html

提交回复
热议问题