Possible Duplicate:
Android: How can I get the current foreground activity (from a service)?
Optionally starting activities and using notifications from services in Android. Only launch or notify if a certain app is present
If I produce a notification when I get an update in my SyncService, how do I prevent it from appearing if I am already in the activity that uses the new information?
It's kind of like when you use the gmail app, a notification will come when you are outside of the app, but you never see it when you are in it.