0

In my application here is the scenario

  1. Activity A receives a regiID from C2DM
  2. Activity A sends regID to server S
  3. Activity A calls activity B through onActivityResult()
  4. While the user is in activity B, the server S sends a "close" message through C2DM
  5. Activity A receives the message

I want to close activity A and B at this time (however activity B is in foreground). How can I achieve this? [by close i mean finish]

Please guide

Webdzinez
  • 15
  • 5
  • Can You catch in ActivityB that A receives the message? – Rasel Aug 03 '11 at 12:15
  • Thats what I am struggling with - I dont know how to do that either. Since Activity B is already running, how would I send another message from Activity A to Activity B? – Webdzinez Aug 03 '11 at 12:17
  • okay.In A after receiving a message broadcast a message that will be received by the receiver in Activity B.call finish() in the receiver.And after sendBroacast call finish() in A.so two activities are finished – Rasel Aug 03 '11 at 12:24
  • I understand what you are saying (in theory) but not sure how to implement it - could you point me in the direction how to broadcast a message from a parent to child activity? – Webdzinez Aug 03 '11 at 12:26
  • You can send broadcast and then you can receive from anywhere in your application. – Rasel Aug 03 '11 at 12:28
  • How to send and receive broadcast see this http://stackoverflow.com/questions/3907713/how-to-send-and-receive-broadcast-message – Rasel Aug 03 '11 at 12:32

0 Answers0