java – 广播意图回调:result = CANCELED forIntent
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – 广播意图回调:result = CANCELED forIntent,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2472字,纯文字阅读大概需要4分钟。
内容图文
![java – 广播意图回调:result = CANCELED forIntent](/upload/InfoBanner/zyjiaocheng/816/c88b7a0c2c28409994e3420275bf3ade.jpg)
我有一个移动应用程序,它注册到c2dm服务器.
我有一台服务器向我的应用程序发送消息,以发送通知.服务器从谷歌c2dm收到ok结果代码.
在LogCat中我看到我的应用程序收到消息但立即产生我在帖子中的错误.而且我创建的通知也被忽略了.
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) }
我不懂.
我的清单文件是:
<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" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<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>
</manifest>
如果有人可以帮助我.我没有想法
解决方法:
根据此forum post,当接收应用程序在设备上处于停止状态时(例如,通过使用设置中的强制停止),Android 3.1中会出现这种情况.它只会在手动启动时再次开始接收消息.
内容总结
以上是互联网集市为您收集整理的java – 广播意图回调:result = CANCELED forIntent全部内容,希望文章能够帮你解决java – 广播意图回调:result = CANCELED forIntent所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。