I am new to android programming and still trying to figure out ways to achieve what I am looking for. I have been trying to add an action button to the notification message, but it is not showing up. Also, any change i am making to customise the notification message is not taking effect for e.g… set lights, big text etc:
Intent notificationIntent1 = new Intent( context, null );
PendingIntent contentIntent1 = PendingIntent.getActivity(context, 0, null, 0);;
///
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder( context );
notificationBuilder.setSmallIcon(appIcon);
notificationBuilder.setTicker(tickerText);
notificationBuilder.setWhen(System.currentTimeMillis());
notificationBuilder.setContentTitle(contentTitle);
notificationBuilder.setContentText(“testing”);
notificationBuilder.setAutoCancel(true);
notificationBuilder.setContentIntent(contentIntent);
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle());
notificationBuilder.addAction(new NotificationCompat.Action(R.drawable.icon, “futher”,contentIntent1));
// notificationBuilder.addAction(R.drawable.icon,“test”, PendingIntent.getActivity(context, 0,notificationIntent1, 0, null) );
Notification notification = notificationBuilder.build();
NotificationManager notificationManager = (NotificationManager) context.getSystemService( Context.NOTIFICATION_SERVICE );
notificationManager.notify( 0, notification );
Appreciate your assistance in advance