NotificationManager 和 NotificationManagerCompat 之间有什么区别?
2022-09-04 22:58:34
我能够创建通知,因此:
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
notificationManager.notify(NOTIFICATION_ID, notification);
}
所以:
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(MainActivity.this);
notificationManagerCompat.notify(NOTIFICATION_ID, notification);
那么,这些方式之间有什么区别呢?