Alarm Receiver 使用 Intent无法更新值的解决方法
2011-08-12 16:51
671 查看
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#
在新建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#
相关文章推荐
- Windows 10 1607(周年更新)后加入域无法使用WIndows Hello解决方法
- Google VR Demo无法使用cocoapods更新的解决方法
- 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- [ios]xcode更新之后插件无法使用的解决方法
- Windows 10 1607(周年更新)后加入域无法使用WIndows Hello解决方法
- 无法使用此Apple ID 进行更新的解决方法
- (应用程序无法正常启动0xc0000142) 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- WordPress无法使用自动更新,提示填写FTP信息的解决方法。
- (应用程序无法正常启动0xc0000142) 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- win10每次更新后,指纹识别无法使用的解决方法,系统慢解决
- hibernate使用注解无法进行更新操作的解决方法
- 关于asp.net网站发布后,使用登录控件和注册控件时出现“数据库只读,无法进行数据更新”的解决方法
- C++6.0(应用程序无法正常启动0xc0000142) 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- (应用程序无法正常启动0xc0000142) 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- 应用程序无法正常启动0xc0000142) 关于win10周年版更新后无法正常使用vc6.0问题的解决方法
- Android Studio 怎么添加使用第三方jar包及无法编译的问题解决方法
- "无法找到“XXX.exe”的调试信息,或者调试信息不匹配。未使用调试信息生成二进制文件"的解决方法
- word2007无法使用宏的解决方法-设置宏与安装VBA组件
- 关于ASP.NET“操作必须使用一个可更新的查询”问题的解决方法
- shell脚本无法使用source的原因及解决方法