Hi All,

I have a service which I use to update some widgets on my homescreen. This 
service is started when I place my very first widget on the homescreen and 
removed when the last is removed. 
I need to update some of the widgets from data received through the Google 
cloud GCM. I use the gcm.jar lib from Google.

Here is my problem. 
My widgetupdate service and the gcm handler intent service is using the 
same context. This means that when I call:
GCMRegistrar.register(context, SENDER_ID);

It will eventually trigger:
static void internalRegister(Context context, String... senderIds) {
        String flatSenderIds = getFlatSenderIds(senderIds);
        Log.v(TAG, "Registering app "  + context.getPackageName() +
                " of senders " + flatSenderIds);
        Intent intent = new Intent(GCMConstants.INTENT_TO_GCM_REGISTRATION);
        intent.setPackage(GSF_PACKAGE);
        intent.putExtra(GCMConstants.EXTRA_APPLICATION_PENDING_INTENT,
                PendingIntent.getBroadcast(context, 0, new Intent(), 0));
        intent.putExtra(GCMConstants.EXTRA_SENDER, flatSenderIds);
        context.startService(intent);
    }

The very last line starts the GCM intent service - Or this is the 
intention. It actually start my service intent and not its own 
onHandleIntent. How do I change this?

Is it possible to do something to the context so that it will trigger the 
GCMIntentService?

Any help will be much appriciated. 

Is there perhaps a better approach to my architecture?

Best regards
Ole

-- 
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