I want to create a notification that like the red bordered notification in this image:
I know how to create normal notifications like the blue bordered notifications in this image, but I want to show an icon and about 3 lines of information near that. How can I do that? Any suggestion will be appreciated.
Expanded notifications are available from Android 4.1 onwards to handle these scenarios. If you are using
Notification.Builder
orNotificationCompat.Builder
, you would set up a normalBuilder
and a separateBuilder
for the expanded notification, usingNotificationCompat.InboxStyle
or one of the other styles, and connect the two.add RemoteView in notification Here is Sample
widget.xml
check this article there is more style avaialbe
Android Developer
Edited:
The NotificationCompat.Builder is the most easy way to create Notifications on all Android versions. You can even use features that are available with Android 4.1. If your app runs on devices with Android >=4.1 the new features will be used, if run on Android <4.1 the notification will be an simple old notification.
for < 11 API use http://www.framentos.com/en/android-tutorial/2012/02/20/how-to-create-a-custom-notification-on-android/