Alarm Receiver 使用 Intent无法更新值的解决方法
来源:互联网 发布:阿里云服务器域名绑定 编辑:程序博客网 时间:2024/06/05 17:58
Alarm Receiver 使用 Intent无法更新值的解决方法
在新建PendingIntent时,指定Flag: FLAG_UPDATE_CURRENT
如:
PendingIntent sender=PendingIntent.getBroadcast(
myActivity.this,0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
I am using marks' method of alarmreceiver and appservice. I am trying
to pass a record id to the alarmintent through putextra. and receive
it in ontimealarmreceiver in getExtra.
What I observe is, first time record id goes correct (say 11) second
time record id is sent 12, but in receiver i receive record id = 11.
third time too record id -11
whats wrong ?
regards
您需要先登录才能发帖。
要发帖,您需要先加入此论坛。
请先在订阅设置页上更新您的昵称,然后再进行发帖。
您没有发帖的权限。
Mark Murphy 查看个人资料 翻译成中文(简体) 翻译内容(查看原文内容)
更多选项 2009年12月17日, 下午7时52分
发件人:"Mark Murphy" <mmur...@commonsware.com>
日期:Thu, 17 Dec 2009 06:52:12 -0500 (EST)
当地时间:2009年12月17日(星期四) 下午7时52分
主题:Re: [android-developers] wrong intent getting supplied to OneTimeAlarmReceiver.
打印 | 单个帖子 | 显示原始帖 | 举报此帖 | 查找此作者的帖子
> I am using marks' method of alarmreceiver and appservice. I am trying
> to pass a record id to the alarmintent through putextra. and receive
> it in ontimealarmreceiver in getExtra.
> What I observe is, first time record id goes correct (say 11) second
> time record id is sent 12, but in receiver i receive record id = 11.
> third time too record id -11
> whats wrong ?
PendingIntent recycles Intents, in effect. Try specifying
FLAG_UPDATE_CURRENT when you create your PendingIntent.
--
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html
http://groups.google.com/group/android-developers/browse_thread/thread/d3507afeda5f33ba#
- Alarm Receiver 使用 Intent无法更新值的解决方法
- hibernate使用注解无法进行更新操作的解决方法
- [ios]xcode更新之后插件无法使用的解决方法
- 无法使用此Apple ID 进行更新的解决方法
- Google VR Demo无法使用cocoapods更新的解决方法
- 【Alarm】Android中alarm的使用
- alarm函数的使用
- Android Alarm的使用
- linux alarm 的使用
- intent 和 Broadcast Receiver之间的通信
- 静态定义的receiver接收broadcast intent
- Broadcast Receiver 的使用
- Broadcast receiver 的使用
- 数据库只读时无法更新的解决方法
- Android SDK 无法更新的解决方法
- android sdk无法更新的解决方法
- android sdk无法更新的解决方法
- android sdk无法更新的解决方法
- IE6中对于插入的透明背景的.png的图片有灰色背景的解决方案
- 打开MySQL的慢查询记录
- Java软件架构师需要的东西
- vs2008中,在OCX控件中应用doc/view基本步骤
- excel 动态获取某列的和
- Alarm Receiver 使用 Intent无法更新值的解决方法
- mit6837的assignment2,3的总结
- java 代理访问 URLConnection
- Java 转换png jpg gif格式图片的相互转换的实现
- 常见函数实现
- 停止更新CSDN,搬家至www.tiandiyoyo.com
- 研究DataList分页方法
- MFC 静态vector声明与初始化
- 堆积排序(HeapSort) - 改良的选择排序