Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ticker text null in NotificationListenerService

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.

like image 396
Shrenik Avatar asked Feb 21 '14 12:02

Shrenik


1 Answers

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).

like image 57
ianhanniballake Avatar answered Nov 11 '22 05:11

ianhanniballake