广播意图回调:结果=已取消forIntent [英] broadcast intent callback: result=CANCELLED forIntent
问题描述
我有一个移动应用程序,用于注册到C2DM服务器。
I have a mobile app, that registers to a c2dm server.
我有将消息发送到我的应用程序的服务器,推通知。服务器收到好的结果code,从谷歌C2DM。
I have a server that sends a message to my app, to push a notification. The server receives ok result code from google c2dm.
在LogCat中我看到,我的应用程序收到消息,但立即产生错误我在我的职务。而且也是我创建的通知将被忽略。
In LogCat i see that my app receives the message but immediately produces the error i have in my post. And also the notification that i created is ignored.
08-10 16:28:09.157: W/GTalkService(13962): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.example.c2dmclient (has extras) }
我不明白这一点。 我的清单文件是:
i don't get it. My manifest file is:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.c2dmclient"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission android:name="com.example.c2dmclient.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.example.c2dmclient.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="com.example.c2dmclient" />
</intent-filter>
</receiver>
<receiver
android:name=".C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.example.c2dmclient" />
</intent-filter>
</receiver>
<activity android:name="com.example.c2dmclient.RegistrationResultActivity" >
</activity>
<activity android:name="com.example.c2dmclient.MessageReceivedActivity" >
</activity>
</application>
如果有人可以帮我请。我出的想法
If someone could help me please. i'm out of ideas
推荐答案
最后,我发现在那里有问题。当我创建了通知,在标志标识的地方,我已经把0。现在,所有它的工作。
Finally i have found where was the problem. When i was creating the notification, in the place of logo id, i have put 0. Now all it's working.
这篇关于广播意图回调:结果=已取消forIntent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!