ticker text null in NotificationListenerService

android, notifications

Solution

Correct, ticker text is not a required field when building a notification. In fact, the only required notification contents are:

- A small icon - returned by `icon`

- A title - returned by extras.getCharSequence(Notification.EXTRA_TITLE)

- Detail text - returned by extras.getCharSequence(Notification.EXTRA_TEXT)

Unfortunately, the `extras` bundle is only available on Android 4.4 (KitKat) devices - previous versions do not have any easy access to this data - you only have access to the `RemoteViews` which you'd need to inflate and parse manually (definitely not recommended).

Problem

I am writing NotificationListenerService , where I want to get the details of notification sent to status bar. But only thing we get is Ticket text , which is null in some cases.

Original source