Shrenik
Shrenik

Reputation: 399

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.

Upvotes: 5

Views: 1472

Answers (2)

mike47
mike47

Reputation: 2264

Ticker text is optional, and may be null in some cases.

You haven't posted any code, but are you using the onNotificationPosted(StatusBarNotification) method from NotificationListenerService? That was implemented in API 18 (Android 4.3), so it should work for you. The documentation states that the full Notification object should be returned, which should give you more than just the ticker text.

Upvotes: 0

ianhanniballake
ianhanniballake

Reputation: 199900

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

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

Upvotes: 5

Related Questions