I am implementing a notification for Android to parse push notifications in my application. But lately, I understand that the content of notifications is not shown on kitkat. it is displayed only on OS Lollipop.
here is the image ...
on Kitkat 4.4.4:
on Lollipop 5.0: The code for both images is the same:


NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext);
Notification notification = mBuilder.setSmallIcon(smallIcon).setTicker(title)
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setContentTitle(title)
.setStyle(inboxStyle)
.setContentIntent(resultPendingIntent)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), icon))
.setContentText(notifMessage)
.build();
NotificationManager notificationManager = (NotificationManager) mContext
.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(mNotificationId, notification);
for information, I use build tools 23.0.2 (the latest when this question is written). here is my build.gradle application:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
...
what's the difference? Any help would be appreciated. thank you in advance
source
share