Correct.
> Now I just want to update the GUI from this method.
>
> Can I somehow call a method in PushEndpointDemo.java?
No, for two reasons:
1. Because C2DMReceiver is a manifest-registered BroadcastReceiver and
therefore has no access to any activities
2. There might not be an activity, since you have no control over the
timing of when the C2DM message is received (e.g., the user pressed
BACK, the user pressed HOME)
> Do I need a Broadcast Intent to do this?
Possibly.
-- If you want to update an activity or else ignore the message, have
C2DMReceiver send out a private broadcast, picked up by a receiver
registered via registerReceiver() in the activity
-- If you want to update an activity or else raise a notification,
have C2DMReceiver send out an ordered broadcast, as described here:
http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html
-- If you want to update a database, call startActivity() on an
IntentService, and have it do the database I/O, plus possibly
broadcast an Intent to update an activity/raise a notification.
Et cetera.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training...At Your Office: http://commonsware.com/training