简体   繁体   中英

Must the Notifications style be the one of BigTextStyle, BigPictureStyle, InboxStyle and MessagingStyle?

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:

  1. Go to the Project Tab of android studio and right click.
  2. Click on New -> UI Component -> Notification
  3. Enter the required notification name

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM