我对Notification.Builder
的setTicker
理解是,它将在状态栏上显示文本,即使没有用户“下拉”传入的通知。
根据http://developer.android.com/reference/android/app/Notification.Builder.html#setTicker%28java.lang.CharSequence%29
Set the "ticker" text which is sent to accessibility services.
但是,在Android 5中,当有传入通知时,它们不会在状态栏(仅显示一个应用程序图标)中显示文本。
我想知道,在Android 5中, setTicker
还有其他用法吗?
是的,它仍然是。 请参阅以下链接http://developer.android.com/reference/android/app/Notification.html#tickerText
如果您要在设备中启用辅助function服务(针对视觉上受到挑战的人),传递到setTicker()的文本将以可听的方式公布。
setTicker()方法仅在启用了辅助function服务的情况下使用。 它不显示状态栏中的文本。
要重新激活状态栏中显示的文字
notification.setPriority(Notification.PRIORITY_HIGH);