问题
The Android tutorials say to use NotificationManagerCompat
class to show notifications, but since this class has no createNotificationChannels
method, it's a bit awkward to handle 2 different NotificationManager
s.
From my search online it seems that all internal features of NotificationManagerCompat
are specific to Android Wear and have no effect on phone/tablet. Is that observation correct?
回答1:
As stated the NotificationManagerCompat is a "Compatibility library for NotificationManager with fallbacks for older platforms."
It holds in it and IMPL class that behaves differently according to the platform it is installed upon. you can have a look at: NotificationManagerCompat.java
I'm not sure how differently it behaves but what it actually does is overrides certain methods that deal with posting, canceling and checking if notifications are enabled.
来源:https://stackoverflow.com/questions/50192724/does-notificationmanagercompat-only-have-wear-specific-features-in-relation-to-n