Reputation: 63
I have a problem:
I have a UI thread which displays webwiew and another chatActivity which displays chat.
I keep on getting data from server which would be displayed on both Activities.
What is the best way to do this viz doInBackground or Service,
If service, than can i bind 2 activity with 1 service i.e. if user press logout from UI or chatActivity, both activity and service should die otherwise service sud update both activity contents.
I am new to 'service' so any reference or sample code would be helpful.
Upvotes: 1
Views: 341
Reputation: 207912
Sounds like you need to broadcast some information. You than will be able to set broadcast receivers in any activity/service you would like to get notified.
Read more online about Broadcastreceiver and about send broadcast
Upvotes: 1