How to create Custom Notification in android

后端 未结 4 1188
庸人自扰
庸人自扰 2021-02-10 04:51

I need to create a custom notification instead of the default notification in android. Current notification have a icon,heading and message like below image

4条回答
  •  北海茫月
    2021-02-10 05:18

    Notification views

    Normal View - A notification in normal view appears in an area that’s up to 64 dp tall. Even if you create a notification with a big view style, it will appear in normal view until it’s expanded.

    Content title
    Large icon
    Content text
    Content info
    Small icon
    Notification time
    

    Normal View Like enter image description here

    Big View - A notification’s big view appears only when the notification is expanded, which happens when the notification is at the top of the notification drawer, or when the user expands the notification with a gesture. Expanded notifications were first introduced in Android 4.1 JellyBean [API 16]. Expandable notifications were designed to support rich notification style objects called Notification.Style.

    Big View Like

    enter image description here

    Go to this link expandable-notifications-android

    More information on official docs

提交回复
热议问题