Suresh Sharma
Suresh Sharma

Reputation: 57

Activity and thread communications

I have an activity in which i trigger a thread, That thread is updating the ui elements on that same activity. When activity goes background, the thread is still running, but when i resume activity, the thread is running but not updating UI. Can anyone help me out with this?

Upvotes: 0

Views: 61

Answers (1)

Sabyasachi
Sabyasachi

Reputation: 3599

You can use Broadcast Receiver to update the the UI from different Thread. Register the Broadcast receiver inside onResume() and Update the UI inside onreceive() of Broadcast Receiver.

Check below link for referrence.

https://stackoverflow.com/a/25216606/4657385

Upvotes: 1

Related Questions