Updating Activity on receiving through Service
I have an application which uses an IntentService to handle incoming
Google Cloud Messaging messages. Currently I am creating a notification
whenever I get a message through the onHandleIntent() function. The
notification opens up a specific activity and then does some calculations
and updates the UI. I'm trying to make my implementation such that if I am
already on the Activity that the notification will open, then the Service
should be able to update the UI without having to send a notification. I
am assuming I can use a broadcast receiver to do this, but I am not sure
how to implement it such that it should update the Activity only if that
Activity is running else it should post a notification.
I am not sure how to do the following:
Check if the specific Activity is already running.
If the Activity is already running then perform the required Calculations
and UI updates without having to call startActivity()
No comments:
Post a Comment