Saturday, 7 September 2013

Recreating activity with getting a notification

Recreating activity with getting a notification

There is the following task:
There is the first activity (for example, "Activity A"), and the second
activity ("Activity B"). Also there is some Service (just "Service) for
catching notifications from my server. I'd like to realize the following
algorithm:
User is on "Activity A" or "Activity B"
"Service" catches some notification from my server
If user is on "Activity A" then service should create notification on
Notification Bar; if user is on "Activity B" already the service should
just recreate "Activity B" without creating a notification.
If notification has been created user could click by it and go to
"Activity B"
I've made all steps without the third one, because I don't know how I can
get the current activity. Please, tell me, is there any way to detect
which activity is current? Thanks.

No comments:

Post a Comment