我的应用程序从C2DM服务器收到一个意图来注册推送通知(工作正常),并且在通过广播接收器接收到该消息时,它启动一个IntentService(处理从C2DM接收到的意图)。然而调用启动IntentService与此失败:什么原因导致“无法启动服务意图”?
Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION
cat=[com.company.myapp] cmp=com.company.myapp/.receiver.C2DMReceiver
(has extras) }: not found
你能帮我明白这是什么错误意味着? C2DMReceiver类是IntentService的子类,它当然存在。我正在使用Intent.setClass()并直接指定类。编译器接受它,所以我不明白为什么异常说“未找到”。什么没有找到?
如果任何人都可以提供关于调试的任何提示,我真的很感激它。
<receiver android:name="com.company.myapp.receiver.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.company.myapp" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.company.myapp" />
</intent-filter>
</receiver>
哪个标签丢失?我得到同样的错误,也许我犯了同样的错误。 – Janusz
你可以给简要的信息。我也遇到了同样的错误。 –