views:

76

answers:

1

I have a problem:

  1. I have a UI thread which displays webwiew and another chatActivity which displays chat.

  2. I keep on getting data from server which would be displayed on both Activities.

  3. What is the best way to do this viz doInBackground or Service,

  4. 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 wud b helpful. Thank you for your consideration :)

+1  A: 

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

Pentium10