Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Notification.Builder vs NotificationCompat.Builder [duplicate]

Pretty much all the bits of sample code I see for Android notififactions appear to use NotificationCompat. I have written up my own code using Notification.Builder. It is not clear to me what benefits, if any, there might be in using NotificationCompat.Builder. I hope that someone here might be able to explain the differences.

like image 754
DroidOS Avatar asked Sep 28 '16 13:09

DroidOS


1 Answers

depends on what you are trying to do and what OS version's your app is compatible with but in most cases you would want to use NotificationCompat because that provides backwards compatibility where as if you wanted to provide that with the regular Notification.Builder you would have to check what OS version the device has yourself to use API calls that are not in older versions

like image 186
tyczj Avatar answered Sep 27 '22 21:09

tyczj