Start IntentService from Activity and refresh Activity when IntentService is finished

后端 未结 5 1131
-上瘾入骨i
-上瘾入骨i 2020-12-08 05:04

In my Android application, I have a simple list view with adapter. There\'s a heavy query which is to fill the list view with data. So I put it to an IntentService that runs

5条回答
  •  天涯浪人
    2020-12-08 05:12

    None of the other answers references the official android documentation

    https://developer.android.com/training/run-background-service/report-status.html

    that states clearly that for the Activity-IntentService communication "The recommended way to send and receive status is to use a LocalBroadcastManager, which limits broadcast Intent objects to components in your own app"!

提交回复
热议问题