Question: I'm downloading data in Android app. The flow is- Activity starts a service which downloads multiple files using [DownloadManager](http://developer.android.com/reference/android/app/DownloadManager.html). Now I want to show the progress in Activity UI. How can I send progress from service to activity?

My approach is- broadcast a message when a file is downloaded by service. In Activity, use broadcast receiver to receive progress. Is this approach good enough? If not what is the best way to do?

Answer: 
To communicate with your activity you can use `LocalBroadCastManager`.

Send update from service:

```
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);

```

Receive update in activity:

```
LocalBroadcastManager.getInstance(context).registerReceiver(
                receiver, intentFilter);

```

Check document <https://developer.android.com/training/run-background-service/report-status.html#ReportStatus>
Just create a static method in the activity...

**Like this**

```
public static void updateUI(String value) {
  //your coding logic
}

```

Then call this from your service

**Like This**

```
(Your activity name).updateUI(value);

```