安卓5.0以上系统notification中setTicker无效

StackOverflow上的提问



My understanding on Notification.Builder's setTicker is that, it will show text on status bar, even without having user to "pull down" the incoming notification.

According tohttp://developer.android.com/reference/android/app/Notification.Builder.html#setTicker%28java.lang.CharSequence%29

Set the "ticker" text which is sent to accessibility services.

However, in Android 5, they no longer show text in the status bar (Only showing a single app icon), when there is incoming notification.

I was wondering, does setTicker still have other usage, in Android 5?


回答是:

Yes, it still does. Please see the following link http://developer.android.com/reference/android/app/Notification.html#tickerText


If you were to turn on accessibility services in your device (for like visually challenged people), the text passed onto setTicker() will be audibly announced.

The setTicker() method only has usage with accessibility services enabled. It does not show a text in the status bar.


就是或5.0之后只有开启扶住功能后Ticker才有用,而且也不会在状态栏里显示了


在4.4的平板上测试后Ticker功能正常

My understanding on Notification.Builder's setTicker is that, it will show text on status bar, even without having user to "pull down" the incoming notification.

According tohttp://developer.android.com/reference/android/app/Notification.Builder.html#setTicker%28java.lang.CharSequence%29

Set the "ticker" text which is sent to accessibility services.

However, in Android 5, they no longer show text in the status bar (Only showing a single app icon), when there is incoming notification.

I was wondering, does setTicker still have other usage, in Android 5?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值