安卓:setOnClickPendingIntent在姜饼一个状态通知 [英] Android: setOnClickPendingIntent in a statusbar notification on Gingerbread

查看:187
本文介绍了安卓:setOnClickPendingIntent在姜饼一个状态通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个应用程序,有两个按钮,一个自定义通知每当被显示出来。我建立了一个OnClickPendinIntent每个按钮,让他们可以在此基础上按钮被pressed执行2个不同的动作。我的应用程序完美地工作的AOSP升级Froyo光盘上,但一旦我升级我的电话姜饼,按钮不再是点击。基本上,无论你在哪里美元通知p $ PSS,它只能作为被点击的通知注册。该按钮被完全忽略。

这是东西,只是需要codeD不同姜饼?或者没有的功能得到某种原因删除?而且没有任何解决方案,以重新启用此功能?

感谢。


解决方案

  

或者做了功能出于某种原因遭到移除?


的功能从未有摆在首位。你不能把一个通知 RemoteViews 交互式元素。有些设备将支持这一点,但它不是平台的一部分。

I made an app that had two buttons in a custom notification whenever it was displayed. I set up an OnClickPendinIntent for each of the buttons, so that they could perform 2 different actions based on which button was pressed. My app worked flawlessly on an AOSP Froyo ROM, but once I upgraded my phone to Gingerbread, the buttons are no longer clickable. Basically, no matter where you press on the notification, it only registers as the notification being clicked. The buttons are being completely ignored.

Is this something that just needs to be coded differently in Gingerbread? Or did the functionality get removed for some reason? And is there any solution to re-enable this functionality?

Thanks.

解决方案

Or did the functionality get removed for some reason?

The functionality was never there in the first place. You cannot put interactive elements on a Notification's RemoteViews. Some devices would support this, but it's not part of the platform.

这篇关于安卓:setOnClickPendingIntent在姜饼一个状态通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆