private void showSmallNotification(NotificationCompat.Builder mBuilder, int icon, String title, String message,
String timeStamp, PendingIntent resultPendingIntent, Uri alarmSound) {
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
if (G.appendNotificationMessages) {
// store the notification in shared pref first
mPreferenceManager.addNotification(message);
// get the notifications from shared preferences
String oldNotification = mPreferenceManager.getNotifications();
List<String> messages = Arrays.asList(oldNotification.split("\\|"));
Log.i(TAG,"showSmallNotification "+ messages);
for (int i = messages.size() - 1; i >= 0; i--) {
inboxStyle.addLine(messages.get(i));
}
} else {
Log.i(TAG,"showSmallNotification-n "+ message);
inboxStyle.addLine(message);
}
Notification notification;
notification = mBuilder.setSmallIcon(icon).setTicker(title).setWhen(0).setAutoCancel(true)
.setContentTitle(title).setContentIntent(resultPendingIntent).setSound(alarmSound).setStyle(inboxStyle)
.setWhen(getTimeMilliSec(timeStamp)).setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), icon)).setContentText(message)
.build();
NotificationManager notificationManager = (NotificationManager) mContext
.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(G.NOTIFICATION_ID, notification);
}