问题
Specifically, I think anything done with NotificationCompat can be done using the default API (level 8). What am I missing here? What does NotificationCompat introduce that cannot be done using 2.2 API?
Source: http://developer.android.com/sdk/compatibility-library.html#Notes
回答1:
You can use things like NotificationCompat.Builder#setLargeIcon(Bitmap) to allow you to take full advantage of Android 3.0+ with things like the large icon, while maintaining compatibility on versions of Android prior to 3.0 that do not support such things.
回答2:
Though its old question, now NotificationCompat can also be used to create wearable specific notifications. More information on this google's developer guide.
http://developer.android.com/training/wearables/notifications/creating.html
回答3:
It allows you to use the NotificationCompat.Builder class, a compatibly version of Notification.Builder from API 11+. As its name suggests its an implementation of the builder pattern, which seems to be its main advantage over the pre Android 3.0 notifications.
来源:https://stackoverflow.com/questions/10071086/why-is-notificationcompat-needed