Hello everybody.
I'm trying to implement a C2DM service over a barebones "hello world"
application with two buttons.
At first I used a BroadcastReceiver, but it has a 10 second execution
limit and a few other limitations,
so I thought it would be better to use the IntentService approach
(google's C2DM samples).
I picked the crome-to-phone example.

The problem is that  when executing the following lines:

    static void runIntentInService(Context context, Intent intent) {
        if (mWakeLock == null) {
            // This is called from BroadcastReceiver, there is no
init.
            PowerManager pm =
                (PowerManager)
context.getSystemService(Context.POWER_SERVICE);
            mWakeLock =
pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
                    WAKELOCK_KEY);
        }
        mWakeLock.acquire();

        intent.setClassName(context,
"com.example.helloandroidc2dm.C2DMReceiver");
        context.startService(intent); <=== HERE
    }

the JVM throws what seems to be a recursive InstantiationException.

Normally, that would be because of abstract methods, but after
changing the class to no longer
be an abstract class, it still happens.

Does anyone have (at least) a pointer for where I should start
debugging ?

Thanks in advance.

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