I need some advice for my application structure. It's about messaging using GCM.
So I get onMessageReceived call in GcmListenerService (with message data).
Now there are two cases:
a) There already is a chat activity in Activity Stack and I should send there an Intent with information about new message so that the activity updates its views
b) There's no opened chat activity at the moment, so I'm just gonna show a Notification.
The important thing is, I do NOT wanna show the notification if there's an activity on top of the stack.
How do I detect whether there's a chat activity in activity stack?