When you show longer text in notification message, you can notice that the text is stripped away. So if want to show the full text in multiple lines, you need to use additional setStyle() method while your building the notification builder.

int icon = R.drawable.ic_notification;

int mNotificationId = 001;

PendingIntent resultPendingIntent =

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
Notification notification = mBuilder.setSmallIcon(icon).setTicker(title).setWhen(0)
        .setStyle(new NotificationCompat.BigTextStyle().bigText(message))
        .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.mipmap.ic_logo))

NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(mNotificationId, notification);

Ravi is hardcore Android programmer and Android programming has been his passion since he compiled his first hello-world program. Solving real problems of Android developers through tutorials has always been interesting part for him.

  • thanks,useful

    • chandru sekar

      Thank you. It’s working some device only

  • Onuwa Nnachi Isaac

    Wonderful… Started following your site today… Kudos for your wonderful tutorials

  • Shakti Nilange

    No its not working i still getting it like before one

    • Akash

      yes its not working

  • Mohammad


  • Pragnesh

    Great man!

  • Kuls

    Thanks buddy

  • Nguyễn Đức Quang

    Thanks so much.:))

  • Feni Kadivar

    thank u soo much…its working …!!

  • raja guru


  • Sandeep Autade

    Thanks you

  • cindy

    not working.

  • thanksyou so much

  • Chinmaykumar Gajjar

    I am using GCM and I want GCM notification to show in multiline. I have extended GcmReceiver and created local notification by getting data from GCM which shows in multiline, but now I have GCM as well as this local one. I don’t know how to show GCM notification multiline.

  • venkat

    Is it possible to achieve multiple messages in single notification like whats App and Gmail?

  • Kb

    I am trying to set BigContentTitle but the notification still won’t display the entire title

    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
    .setColor(ContextCompat.getColor(this, R.color.colorPrimary))

    NotificationCompat.BigTextStyle style = new NotificationCompat.BigTextStyle(notificationBuilder);

    what am I doing wrong ?

  • Nirant Enterprise

    Hello sir,
    Your article is very easily understand.But i have one issue how to all notification show in device screen.when i send one notification that is show .after another notification send that’s time first notification not show replace mode open another notification .how to solve that.

    Please,say that how to all notification show in screen??

    Thank you

    • Each notification will have a unique id. You have to use different ids for notifications. In the code
      int mNotificationId = 001;
      is same for all notifications. It has to be random.

      • Nirant Enterprise

        thank-you so much sir . yes i change the notifications id that’s completely working in my application.

  • HimanAshu Srivastava

    This article is really very helpful. But I want to change notification text color, how can I do that?

  • sagu hildon

    HI Have you tried in C# ?
    Can you please tell how to send multiple message to same device id (GCM)?
    Below is the postdata to send message using GCM service,
    string postData = “collapse_key=score_update&time_to_live=108&delay_while_idle=1&data.message=”
    + value + “&data.time=” + System.DateTime.Now.ToString() + “&data.title=”
    + “MCT Alert Notification” + “&registration_id=” + regId + “”;

    • Saravana Kumar Narayanan

      Did you get any solution through c#, i am struggling to find a solution.

  • saurabh

    I am trying to set Bigtext but the notification still single line message ?

    mBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(message));

    i want to show multiple line in notification, I am using Firebase Push Notification.

    • Which device you are testing it on? Some devices (like MI) won’t show big text notifications.

      • saurabh

        Yes you are right sir , I am testing on Mi device and on other devices it work fine , thanks sir

  • Chandan Kumar

    Hi Ravi, While using NotificationCompat.BigPictureStyle I want to put summary in two lines. How I can achieve it ?

  • Archi rayan

    Hello ,

    How to make Expand Notification same like whatsapp. fullscreen view the Notification

    please, any one idea?

  • Ritesh Singh

    any idea how we can do this in phonegap?

  • Heba Hmidan

    hello i want to get the notification only on the homescreen from only admin not on a bar
    ps: i am a beginner

  • pradeepkumar reddy

    if i have multiple notifications, only one notifcation is displayed in multi-line, other notifcations are being displayed in single line. I’m using motorola phone(MOTO C)

  • Serious

    I want the setSummaryText switch to the setContentTitle after clicking on the notification. How?

  • suresh Dobariya

    fire base puch notification in big Image not working (i think image Url to bitmap not convert)

  • Bhavna Mulani

    I want to achieve multiple lines with big picture in push notification, i have added set style but it’s not working.
    .setStyle(new NotificationCompat.BigTextStyle() //handles big/large text
    if (image != null) {
    notificationBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(image));