You could use 
the 
http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html
 
to fire a local broadcast (only to your process, unlike the normal 
Broadcast). If you are using the message as a send-to-sync type then just 
pass in an boolean extra.

You could also make your activity bind to your GCMIntentService and then 
use a listener interface to subscribe to it. Once a message arrives then 
loop through all the listeners and invoke them. Remember to unbind() once 
the activity is dead.

On Friday, August 10, 2012 8:15:45 AM UTC-7, Wolfgang wrote:
>
> Hey guys,
>  
> I have a activity called GetList. This class contains a listview whose 
> data comes from my server. My server sends a message through GCM and the 
> phone receives it and displays the message. I am trying to get the app to 
> refresh the listview when a message is received. However the onMessage() is 
> in the class GCMIntentService and GetList is a seperate class. I tried 
> using a static method in GetList, but this won't work because the listview 
> is not static and I would like to avoid making everything in the class 
> static. Any thoughts on how I can accomplish this?
>  
> Thanks,
>  
> -W
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to