1

Is there any replacement for Notification.number field that was deprecated with Android API 24?

Documentation says:

This field was deprecated in API level 24. this number is not shown anymore

Looks like Notification.EXTRA_INFO_TEXT also gives null.

Does anyone know a workaround?

1 Answers1

0

It is now undeprecated in API 26, and is now shown as a badge on certain launchers. How very strange.

For API 24-25, I think you were expected to stack multiple notifications in a group. Which doesn't work if you want the number to be eg '100 new emails' - you aren't going to post 100 notifications. It's good they have re-thought this.

edit: API 26 badge documentation: https://developer.android.com/preview/features/notification-badges.html

rockgecko
  • 4,127
  • 2
  • 18
  • 31