1

Possible Duplicate:
Finishing an Activity from a Broadcast Receiver

Please observe the scenario I have:

Class A extends Activity

Class B extends BroadcastReceiver

How can I finish Activity A from Class B's onReceive method? Any help is much appreciated.

Community
  • 1
  • 1
user264953
  • 1,837
  • 8
  • 37
  • 63
  • maybe http://stackoverflow.com/questions/7486865/remove-or-close-your-own-activity-window-from-a-status-bar-notification-intent/ is helpful – Marc Van Daele Mar 27 '12 at 10:47

1 Answers1

2

The best way to deal with this is to register a broadcast receiver in code inside your activity and listen for that particular broadcast message for which you want to finish your activity.

P.S. Independent Broadcast-Receivers and Services don't have right to manipulate Activities, except for launching Activities as new task.

waqaslam
  • 67,549
  • 16
  • 165
  • 178