According to the documentation that I've seen, the android notification builder was introduced in API 11, and:
If your app supports devices older than API Level 11, you should be using NotificationCompat.Builder
, in which case you can just use build()
all of the time.
Otherwise, you are welcome to just call getNotification()
, until such time as you are willing to support only API Level 16 and higher. They simply renamed the method for greater consistency. If you look at the source code, getNotification()
just calls build()
on newer devices.
There's nothing wrong with using Raghav's approach, and that sort of technique will be required in other situations where there are API level differences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With