android - Update download progress from Service to activity -


I'm downloading data in the Android app. Flow - Activity starts a service that downloads many files. Now I want to show progress in Activity UI How can I send progress from service to activity?

My view is - when a service is downloaded by the file, the message is broadcast. In the activity, use the broadcast receiver to achieve progress. Is this approach quite good? If not, what's the best way?

Just create a static method in the activity ...

This Public Static Zero Update UI (String Value) {// Your Coding Argument}

Then call it from your service

P>

like

  (name of your activity) .updateUI (value);  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -