2

I want to display the notification like this like this

but im getting like thislike this

Im using the code

final Notification notifyDetails = new NotificationCompat.Builder(context)
                                .setContentTitle(mTitle)
                                .setContentText(mDesc)
                                .setSmallIcon(R.mipmap.ic_launcher)
                                .setTicker(mDesc)
                                .setStyle(new NotificationCompat.BigPictureStyle()
                                        .bigPicture(myBitmap)
                                        .setSummaryText(mDesc))
                                .setContentIntent(nIntent)
                                .addAction(R.drawable.share, "Share", nIntent)
                                .build();
                        mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);

How can display my notification like that? I have google it, i didnt get solution. please anyone worked on this, please share your idea.

Thanks a lot in advance

Make it Simple
  • 1,832
  • 5
  • 32
  • 57

2 Answers2

1

For this you will need the custom UI for notification. Refer to the below link for more details on it.

Custom Notification

Mohammed Rampurawala
  • 3,033
  • 2
  • 22
  • 32
0

I hope it will work

Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.image);
        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                .setLargeIcon(bm) 
                .setContentTitle("Event tracker")
                .setContentText("Events received")

Please note large icon must be a bitmap