I researched about this and found out that addAction (int icon, CharSequence title, PendingIntent intent)
is deprecated, so I used addAction (Notification.Action action)
. In both the cases, icon cant be seen.
NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_share, "", pendingIntent).build();
notificationBuilder.addAction(action);
The text seems to be working though, but I have left it blank, hence there is an empty space below the main image, where icon is supposed to be displayed