I'm learning Notifications, I use Android Studio 4.0 with latest androidx.core.app.NotificationManagerCompat.
There is a sample code about Notifications in the project user-interface-samples.
I find there are many differents about Notifications between this androidx and previous API.
Must the Notifications style be the one of BigTextStyleNotification
, BigPictureStyleNotification
, InboxStyleNotification
and MessagingStyleNotification
?
Following are the notification styles available:
Notification.BigPictureStyle, Notification.BigTextStyle, Notification.DecoratedCustomViewStyle, Notification.InboxStyle, Notification.MediaStyle, Notification.MessagingStyle
You can get more info on this link .
Just for information purposes, to create a notification without hustle and get all predefined formatting in one place, just do the following:
To call this notification just enter the following:
<NotificationClassName>.createNotification(getApplicationContext());
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.